Initial commit
This commit is contained in:
32
app/Console/Kernel.php
Normal file
32
app/Console/Kernel.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
13
app/Core/Bootstrap/BootstrapAuth.php
Normal file
13
app/Core/Bootstrap/BootstrapAuth.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Bootstrap;
|
||||
|
||||
class BootstrapAuth
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
// See also starterkit/app/View/Components/SystemLayout.php to change the layout
|
||||
|
||||
addHtmlClass('body', 'app-blank');
|
||||
}
|
||||
}
|
87
app/Core/Bootstrap/BootstrapDefault.php
Normal file
87
app/Core/Bootstrap/BootstrapDefault.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Bootstrap;
|
||||
|
||||
class BootstrapDefault
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
// 1) Light sidebar layout (default.html)
|
||||
// $this->initLightSidebarLayout();
|
||||
|
||||
// 2) Dark sidebar layout (default.html)
|
||||
$this->initDarkSidebarLayout();
|
||||
|
||||
// 3) Dark header layout (default_header_layout.html)
|
||||
// $this->initDarkHeaderLayout();
|
||||
|
||||
// 4) Light header layout (default_header_layout.html)
|
||||
// $this->initLightHeaderLayout();
|
||||
|
||||
# Init global assets for default layout
|
||||
$this->initAssets();
|
||||
}
|
||||
|
||||
public function initAssets()
|
||||
{
|
||||
# Include global vendors
|
||||
addVendors(['datatables', 'fullcalendar']);
|
||||
|
||||
# Include global javascript files
|
||||
addJavascriptFile('assets/js/custom/widgets.js');
|
||||
addJavascriptFile('assets/js/custom/apps/chat/chat.js');
|
||||
addJavascriptFile('assets/js/custom/utilities/modals/upgrade-plan.js');
|
||||
addJavascriptFile('assets/js/custom/utilities/modals/create-app.js');
|
||||
addJavascriptFile('assets/js/custom/utilities/modals/users-search.js');
|
||||
addJavascriptFile('assets/js/custom/utilities/modals/new-target.js');
|
||||
}
|
||||
|
||||
public function initDarkSidebarLayout()
|
||||
{
|
||||
addHtmlAttribute('body', 'data-kt-app-layout', 'dark-sidebar');
|
||||
addHtmlAttribute('body', 'data-kt-app-header-fixed', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-enabled', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-fixed', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-hoverable', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-push-header', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-push-toolbar', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-push-footer', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-toolbar-enabled', 'true');
|
||||
|
||||
addHtmlClass('body', 'app-default');
|
||||
}
|
||||
|
||||
public function initLightSidebarLayout()
|
||||
{
|
||||
addHtmlAttribute('body', 'data-kt-app-layout', 'light-sidebar');
|
||||
addHtmlAttribute('body', 'data-kt-app-header-fixed', 'false');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-enabled', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-fixed', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-hoverable', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-push-header', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-push-toolbar', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-sidebar-push-footer', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-toolbar-enabled', 'true');
|
||||
|
||||
addHtmlClass('body', 'app-default');
|
||||
}
|
||||
|
||||
public function initDarkHeaderLayout()
|
||||
{
|
||||
addHtmlAttribute('body', 'data-kt-app-layout', 'dark-header');
|
||||
addHtmlAttribute('body', 'data-kt-app-header-fixed', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-toolbar-enabled', 'true');
|
||||
|
||||
addHtmlClass('body', 'app-default');
|
||||
}
|
||||
|
||||
public function initLightHeaderLayout()
|
||||
{
|
||||
addHtmlAttribute('body', 'data-kt-app-layout', 'light-header');
|
||||
addHtmlAttribute('body', 'data-kt-app-header-fixed', 'true');
|
||||
addHtmlAttribute('body', 'data-kt-app-toolbar-enabled', 'true');
|
||||
|
||||
addHtmlClass('body', 'app-default');
|
||||
}
|
||||
|
||||
}
|
13
app/Core/Bootstrap/BootstrapSystem.php
Normal file
13
app/Core/Bootstrap/BootstrapSystem.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Bootstrap;
|
||||
|
||||
class BootstrapSystem
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
// See also starterkit/app/View/Components/SystemLayout.php to change the layout
|
||||
|
||||
addHtmlClass('body', 'app-blank');
|
||||
}
|
||||
}
|
420
app/Core/Theme.php
Normal file
420
app/Core/Theme.php
Normal file
@ -0,0 +1,420 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
class Theme
|
||||
{
|
||||
/**
|
||||
* Variables
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public static $modeSwitchEnabled = false;
|
||||
public static $modeDefault = 'light';
|
||||
|
||||
public static $direction = 'ltr';
|
||||
|
||||
public static $htmlAttributes = [];
|
||||
public static $htmlClasses = [];
|
||||
|
||||
|
||||
/**
|
||||
* Keep page level assets
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $javascriptFiles = [];
|
||||
public static $cssFiles = [];
|
||||
public static $vendorFiles = [];
|
||||
|
||||
/**
|
||||
* Get product name
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Add HTML attributes by scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $name
|
||||
* @param $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addHtmlAttribute($scope, $name, $value)
|
||||
{
|
||||
self::$htmlAttributes[$scope][$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple HTML attributes by scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $attributes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addHtmlAttributes($scope, $attributes)
|
||||
{
|
||||
foreach ($attributes as $key => $value) {
|
||||
self::$htmlAttributes[$scope][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add HTML class by scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addHtmlClass($scope, $value)
|
||||
{
|
||||
self::$htmlClasses[$scope][] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove HTML class by scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function removeHtmlClass($scope, $value)
|
||||
{
|
||||
$key = array_search($value, self::$htmlClasses[$scope]);
|
||||
unset(self::$htmlClasses[$scope][$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print HTML attributes for the HTML template
|
||||
*
|
||||
* @param $scope
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function printHtmlAttributes($scope)
|
||||
{
|
||||
$attributes = [];
|
||||
if (isset(self::$htmlAttributes[$scope])) {
|
||||
foreach (self::$htmlAttributes[$scope] as $key => $value) {
|
||||
$attributes[] = sprintf('%s="%s"', $key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
return join(' ', $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print HTML classes for the HTML template
|
||||
*
|
||||
* @param $scope
|
||||
* @param $full
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function printHtmlClasses($scope, $full = true)
|
||||
{
|
||||
if (empty(self::$htmlClasses)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$classes = [];
|
||||
if (isset(self::$htmlClasses[$scope])) {
|
||||
$classes = self::$htmlClasses[$scope];
|
||||
}
|
||||
|
||||
if ($full) {
|
||||
return sprintf('class="%s"', implode(' ', (array) $classes));
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SVG icon content
|
||||
*
|
||||
* @param $path
|
||||
* @param $classNames
|
||||
* @param $folder
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getSvgIcon($path, $classNames = 'svg-icon')
|
||||
{
|
||||
if (file_exists(public_path('assets/media/icons/'.$path))) {
|
||||
return sprintf('<span class="%s">%s</span>', $classNames, file_get_contents(public_path('assets/media/icons/'.$path)));
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set dark mode enabled status
|
||||
*
|
||||
* @param $flag
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setModeSwitch($flag)
|
||||
{
|
||||
self::$modeSwitchEnabled = $flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check dark mode status
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function isModeSwitchEnabled()
|
||||
{
|
||||
return self::$modeSwitchEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the mode to dark or light
|
||||
*
|
||||
* @param $mode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setModeDefault($mode)
|
||||
{
|
||||
self::$modeDefault = $mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current mode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getModeDefault()
|
||||
{
|
||||
return self::$modeDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set style direction
|
||||
*
|
||||
* @param $direction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setDirection($direction)
|
||||
{
|
||||
self::$direction = $direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get style direction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getDirection()
|
||||
{
|
||||
return self::$direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend CSS file name with RTL or dark mode
|
||||
*
|
||||
* @param $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function extendCssFilename($path)
|
||||
{
|
||||
if ($this->isRtlDirection()) {
|
||||
$path = str_replace('.css', '.rtl.css');
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if style direction is RTL
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function isRtlDirection()
|
||||
{
|
||||
return self::$direction === 'rtl';
|
||||
}
|
||||
|
||||
/**
|
||||
* Include favicon from settings
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function includeFavicon()
|
||||
{
|
||||
return sprintf('<link rel="shortcut icon" href="%s" />', asset(config('settings.KT_THEME_ASSETS.favicon')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Include the fonts from settings
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function includeFonts()
|
||||
{
|
||||
$content = '';
|
||||
|
||||
foreach (config('settings.KT_THEME_ASSETS.fonts') as $url) {
|
||||
$content .= sprintf('<link rel="stylesheet" href="%s">', asset($url));
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the global assets
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getGlobalAssets($type = 'js')
|
||||
{
|
||||
// $this->extendCssFilename()
|
||||
return config('settings.KT_THEME_ASSETS.global.'.$type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple vendors to the page by name. Refer to settings KT_THEME_VENDORS
|
||||
*
|
||||
* @param $vendors
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function addVendors($vendors)
|
||||
{
|
||||
foreach ($vendors as $value) {
|
||||
self::$vendorFiles[] = $value;
|
||||
}
|
||||
|
||||
return array_unique(self::$vendorFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add single vendor to the page by name. Refer to settings KT_THEME_VENDORS
|
||||
*
|
||||
* @param $vendor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addVendor($vendor)
|
||||
{
|
||||
self::$vendorFiles[] = $vendor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom javascript file to the page
|
||||
*
|
||||
* @param $file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addJavascriptFile($file)
|
||||
{
|
||||
self::$javascriptFiles[] = $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom CSS file to the page
|
||||
*
|
||||
* @param $file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addCssFile($file)
|
||||
{
|
||||
self::$cssFiles[] = $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get vendor files from settings. Refer to settings KT_THEME_VENDORS
|
||||
*
|
||||
* @param $type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getVendors($type)
|
||||
{
|
||||
$files = [];
|
||||
foreach (self::$vendorFiles as $vendor) {
|
||||
$vendors = config('settings.KT_THEME_VENDORS.'.$vendor);
|
||||
if (isset($vendors[$type])) {
|
||||
foreach ($vendors[$type] as $path) {
|
||||
$files[] = $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array_unique($files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom js files from the settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getCustomJs()
|
||||
{
|
||||
return self::$javascriptFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom css files from the settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getCustomCss()
|
||||
{
|
||||
return self::$cssFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML attribute based on the scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $attribute
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getHtmlAttribute($scope, $attribute)
|
||||
{
|
||||
return self::$htmlAttributes[$scope][$attribute] ?? [];
|
||||
}
|
||||
|
||||
function getIcon($name, $class = '', $type = '')
|
||||
{
|
||||
$type = config('settings.KT_THEME_ICONS', 'duotone');
|
||||
|
||||
$tag = 'span';
|
||||
|
||||
if ($type === 'duotone') {
|
||||
$icons = cache()->remember('duotone-icons', 3600, function () {
|
||||
return json_decode(file_get_contents(public_path('icons.json')), true);
|
||||
});
|
||||
|
||||
$pathsNumber = data_get($icons, 'duotone-paths.'.$name, 0);
|
||||
|
||||
$output = '<'.$tag.' class="ki-'.$type.' ki-'.$name.(!empty($class) ? " ".$class : '').'">';
|
||||
|
||||
for ($i = 0; $i < $pathsNumber; $i++) {
|
||||
$output .= '<'.$tag.' class="path'.($i + 1).'"></'.$tag.'>';
|
||||
}
|
||||
|
||||
$output .= '</'.$tag.'>';
|
||||
} else {
|
||||
$output = '<'.$tag.' class="ki-'.$type.' ki-'.$name.(!empty($class) ? " ".$class : '').'"></'.$tag.'>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
60
app/Exceptions/Handler.php
Normal file
60
app/Exceptions/Handler.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of exception types with their corresponding custom log levels.
|
||||
*
|
||||
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
|
||||
*/
|
||||
protected $levels = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of the exception types that are not reported.
|
||||
*
|
||||
* @var array<int, class-string<\Throwable>>
|
||||
*/
|
||||
protected $dontReport = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of the inputs that are never flashed to the session on validation exceptions.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $dontFlash = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register the exception handling callbacks for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
//
|
||||
});
|
||||
|
||||
$this->renderable(function (NotFoundHttpException $e, $request) {
|
||||
if ($request->is('api/*')) {
|
||||
return response()->json([
|
||||
'message' => 'Not found.'
|
||||
], 404);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
545
app/Helpers/Helpers.php
Normal file
545
app/Helpers/Helpers.php
Normal file
@ -0,0 +1,545 @@
|
||||
<?php
|
||||
|
||||
if (!function_exists('theme')) {
|
||||
function theme()
|
||||
{
|
||||
return app(App\Core\Theme::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getName')) {
|
||||
/**
|
||||
* Get product name
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
return config('settings.KT_THEME');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('addHtmlAttribute')) {
|
||||
/**
|
||||
* Add HTML attributes by scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $name
|
||||
* @param $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addHtmlAttribute($scope, $name, $value)
|
||||
{
|
||||
theme()->addHtmlAttribute($scope, $name, $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('addHtmlAttributes')) {
|
||||
/**
|
||||
* Add multiple HTML attributes by scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $attributes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addHtmlAttributes($scope, $attributes)
|
||||
{
|
||||
theme()->addHtmlAttributes($scope, $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('addHtmlClass')) {
|
||||
/**
|
||||
* Add HTML class by scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addHtmlClass($scope, $value)
|
||||
{
|
||||
theme()->addHtmlClass($scope, $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('printHtmlAttributes')) {
|
||||
/**
|
||||
* Print HTML attributes for the HTML template
|
||||
*
|
||||
* @param $scope
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function printHtmlAttributes($scope)
|
||||
{
|
||||
return theme()->printHtmlAttributes($scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('printHtmlClasses')) {
|
||||
/**
|
||||
* Print HTML classes for the HTML template
|
||||
*
|
||||
* @param $scope
|
||||
* @param $full
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function printHtmlClasses($scope, $full = true)
|
||||
{
|
||||
return theme()->printHtmlClasses($scope, $full);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getSvgIcon')) {
|
||||
/**
|
||||
* Get SVG icon content
|
||||
*
|
||||
* @param $path
|
||||
* @param $classNames
|
||||
* @param $folder
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getSvgIcon($path, $classNames = 'svg-icon', $folder = 'assets/media/icons/')
|
||||
{
|
||||
return theme()->getSvgIcon($path, $classNames, $folder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('setModeSwitch')) {
|
||||
/**
|
||||
* Set dark mode enabled status
|
||||
*
|
||||
* @param $flag
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setModeSwitch($flag)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('isModeSwitchEnabled')) {
|
||||
/**
|
||||
* Check dark mode status
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function isModeSwitchEnabled()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('setModeDefault')) {
|
||||
/**
|
||||
* Set the mode to dark or light
|
||||
*
|
||||
* @param $mode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setModeDefault($mode)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getModeDefault')) {
|
||||
/**
|
||||
* Get current mode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function getModeDefault()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('setDirection')) {
|
||||
/**
|
||||
* Set style direction
|
||||
*
|
||||
* @param $direction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setDirection($direction)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getDirection')) {
|
||||
/**
|
||||
* Get style direction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function getDirection()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('isRtlDirection')) {
|
||||
/**
|
||||
* Check if style direction is RTL
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function isRtlDirection()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('extendCssFilename')) {
|
||||
/**
|
||||
* Extend CSS file name with RTL or dark mode
|
||||
*
|
||||
* @param $path
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function extendCssFilename($path)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('includeFavicon')) {
|
||||
/**
|
||||
* Include favicon from settings
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function includeFavicon()
|
||||
{
|
||||
return theme()->includeFavicon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('includeFonts')) {
|
||||
/**
|
||||
* Include the fonts from settings
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function includeFonts()
|
||||
{
|
||||
return theme()->includeFonts();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getGlobalAssets')) {
|
||||
/**
|
||||
* Get the global assets
|
||||
*
|
||||
* @param $type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getGlobalAssets($type = 'js')
|
||||
{
|
||||
return theme()->getGlobalAssets($type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('addVendors')) {
|
||||
/**
|
||||
* Add multiple vendors to the page by name. Refer to settings KT_THEME_VENDORS
|
||||
*
|
||||
* @param $vendors
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addVendors($vendors)
|
||||
{
|
||||
theme()->addVendors($vendors);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('addVendor')) {
|
||||
/**
|
||||
* Add single vendor to the page by name. Refer to settings KT_THEME_VENDORS
|
||||
*
|
||||
* @param $vendor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addVendor($vendor)
|
||||
{
|
||||
theme()->addVendor($vendor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('addJavascriptFile')) {
|
||||
/**
|
||||
* Add custom javascript file to the page
|
||||
*
|
||||
* @param $file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addJavascriptFile($file)
|
||||
{
|
||||
theme()->addJavascriptFile($file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('addCssFile')) {
|
||||
/**
|
||||
* Add custom CSS file to the page
|
||||
*
|
||||
* @param $file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function addCssFile($file)
|
||||
{
|
||||
theme()->addCssFile($file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getVendors')) {
|
||||
/**
|
||||
* Get vendor files from settings. Refer to settings KT_THEME_VENDORS
|
||||
*
|
||||
* @param $type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getVendors($type)
|
||||
{
|
||||
return theme()->getVendors($type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getCustomJs')) {
|
||||
/**
|
||||
* Get custom js files from the settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getCustomJs()
|
||||
{
|
||||
return theme()->getCustomJs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getCustomCss')) {
|
||||
/**
|
||||
* Get custom css files from the settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getCustomCss()
|
||||
{
|
||||
return theme()->getCustomCss();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getHtmlAttribute')) {
|
||||
/**
|
||||
* Get HTML attribute based on the scope
|
||||
*
|
||||
* @param $scope
|
||||
* @param $attribute
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getHtmlAttribute($scope, $attribute)
|
||||
{
|
||||
return theme()->getHtmlAttribute($scope, $attribute);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('isUrl')) {
|
||||
/**
|
||||
* Get HTML attribute based on the scope
|
||||
*
|
||||
* @param $url
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function isUrl($url)
|
||||
{
|
||||
return filter_var($url, FILTER_VALIDATE_URL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('image')) {
|
||||
/**
|
||||
* Get image url by path
|
||||
*
|
||||
* @param $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function image($path)
|
||||
{
|
||||
return asset('assets/media/' . $path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('getIcon')) {
|
||||
/**
|
||||
* Get icon
|
||||
*
|
||||
* @param $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getIcon($name, $class = '', $type = '')
|
||||
{
|
||||
return theme()->getIcon($name, $class, $type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function verify_user($id, $passwd, $SERVER_ADDR, $IPUserManager, $portUserManager, $appId)
|
||||
{
|
||||
|
||||
$USERMANPROG = "user_verification.php";
|
||||
$sock = fsockopen("tcp://" . $IPUserManager, $portUserManager, $errno, $errstr, 30);
|
||||
|
||||
|
||||
if (!$sock) die("$errstr ($errno)\n");
|
||||
|
||||
$data = "appsid=" . urlencode($appId) . "&loginid=" . urlencode($id) . "&passwd=" . urlencode($passwd) . "&addr=" . $SERVER_ADDR . "&version=2";
|
||||
|
||||
//echo "data: $data <BR>";
|
||||
|
||||
fwrite($sock, "POST /user_verification_dev.php HTTP/1.0\r\n");
|
||||
fwrite($sock, "Host: $IPUserManager\r\n");
|
||||
fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n");
|
||||
fwrite($sock, "Content-length: " . strlen($data) . "\r\n");
|
||||
fwrite($sock, "Accept: */*\r\n");
|
||||
fwrite($sock, "\r\n");
|
||||
fwrite($sock, "$data\r\n");
|
||||
fwrite($sock, "\r\n");
|
||||
|
||||
$headers = "";
|
||||
while ($str = trim(fgets($sock, 4096))) $headers .= "$str\n";
|
||||
|
||||
$body = "";
|
||||
while (!feof($sock)) $body .= fgets($sock, 4096);
|
||||
|
||||
|
||||
fclose($sock);
|
||||
|
||||
return decompress($body);
|
||||
}
|
||||
|
||||
|
||||
function getAllowableScript($sessionMenu)
|
||||
{
|
||||
//$sessionMenu = $_SESSION['MENU'];
|
||||
|
||||
if (!empty($sessionMenu)) {
|
||||
$tempMenuArrayLine = explode('-', $sessionMenu);
|
||||
//print_r($tempMenuArrayLine);
|
||||
if (count($tempMenuArrayLine) > 0) {
|
||||
foreach ($tempMenuArrayLine as $tkey => $tval) {
|
||||
$tempMenuArray = explode('|', $tval);
|
||||
if (count($tempMenuArray) > 0) {
|
||||
foreach ($tempMenuArray as $mkey => $mval) {
|
||||
[$menukey, $menuval] = explode('>', $mval);
|
||||
if ($menukey === 'LINK') {
|
||||
$SCRIPT_ALLOW[$menuval] = 1;
|
||||
}
|
||||
//$menu[$menuCounter][$menukey] = $menuval;
|
||||
}
|
||||
//$menuCounter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $SCRIPT_ALLOW;
|
||||
}
|
||||
|
||||
function decompress($data)
|
||||
{
|
||||
$text = '';
|
||||
$total = strlen($data);
|
||||
for ($j = 0; $j < $total; $j = $j + 2) {
|
||||
$text .= chr(hexdec(substr($data, $j, 2)));
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
function compress($data)
|
||||
{
|
||||
$text = '';
|
||||
$total = strlen($data);
|
||||
for ($i = 0; $i < $total; $i++) {
|
||||
$temp = dechex(ord(substr($data, $i, 1)));
|
||||
if (strlen($temp) < 2) {
|
||||
$temp = '0' . $temp;
|
||||
}
|
||||
$text .= $temp;
|
||||
}
|
||||
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
function jsonToView($jsonText = '')
|
||||
{
|
||||
$arr = json_decode($jsonText, true);
|
||||
$html = "";
|
||||
if ($arr && is_array($arr)) {
|
||||
$html .= _arrayToHtmlTableRecursive($arr);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
function _arrayToHtmlTableRecursive($arr)
|
||||
{
|
||||
$str = "<table><tbody>";
|
||||
foreach ($arr as $key => $val) {
|
||||
$str .= "<tr>";
|
||||
$str .= "<td>$key</td>";
|
||||
$str .= "<td>";
|
||||
if (is_array($val)) {
|
||||
if (!empty($val)) {
|
||||
$str .= _arrayToHtmlTableRecursive($val);
|
||||
}
|
||||
} else {
|
||||
$str .= "<strong>$val</strong>";
|
||||
}
|
||||
$str .= "</td></tr>";
|
||||
}
|
||||
$str .= "</tbody></table>";
|
||||
|
||||
return $str;
|
||||
}
|
43
app/Http/Controllers/ApiController.php
Normal file
43
app/Http/Controllers/ApiController.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller as Controller;
|
||||
|
||||
class ApiController extends Controller
|
||||
{
|
||||
/**
|
||||
* success response method.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function sendResponse($result, $message, $code = 200)
|
||||
{
|
||||
$response = [
|
||||
'success' => true,
|
||||
'data' => $result,
|
||||
'message' => $message,
|
||||
];
|
||||
|
||||
return response()->json($response, $code);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return error response.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function sendError($error, $errorMessages = [], $code = 404)
|
||||
{
|
||||
$response = [
|
||||
'success' => false,
|
||||
'message' => $error,
|
||||
];
|
||||
|
||||
if (!empty($errorMessages)) {
|
||||
$response['data'] = $errorMessages;
|
||||
}
|
||||
|
||||
return response()->json($response, $code);
|
||||
}
|
||||
}
|
13
app/Http/Controllers/Controller.php
Normal file
13
app/Http/Controllers/Controller.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
13
app/Http/Controllers/DashboardController.php
Normal file
13
app/Http/Controllers/DashboardController.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
addVendors(['amcharts', 'amcharts-maps', 'amcharts-stock']);
|
||||
|
||||
return view('pages.dashboards.index');
|
||||
}
|
||||
}
|
67
app/Http/Kernel.php
Normal file
67
app/Http/Kernel.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array<int, class-string|string>
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Illuminate\Http\Middleware\HandleCors::class,
|
||||
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array<string, array<int, class-string|string>>
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array<string, class-string|string>
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'signed' => \App\Http\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
];
|
||||
}
|
21
app/Http/Middleware/Authenticate.php
Normal file
21
app/Http/Middleware/Authenticate.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
{
|
||||
if (! $request->expectsJson()) {
|
||||
return route('login');
|
||||
}
|
||||
}
|
||||
}
|
20
app/Http/Middleware/EncryptCookies.php
Normal file
20
app/Http/Middleware/EncryptCookies.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
"sidebar_minimize_state",
|
||||
"kt_aside_toggle_state",
|
||||
"kt_aside_menu",
|
||||
"data-kt-app-sidebar-minimize",
|
||||
];
|
||||
}
|
17
app/Http/Middleware/PreventRequestsDuringMaintenance.php
Normal file
17
app/Http/Middleware/PreventRequestsDuringMaintenance.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||
|
||||
class PreventRequestsDuringMaintenance extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be reachable while maintenance mode is enabled.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
32
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
32
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param string|null ...$guards
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, ...$guards)
|
||||
{
|
||||
$guards = empty($guards) ? [null] : $guards;
|
||||
|
||||
foreach ($guards as $guard) {
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
19
app/Http/Middleware/TrimStrings.php
Normal file
19
app/Http/Middleware/TrimStrings.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
20
app/Http/Middleware/TrustHosts.php
Normal file
20
app/Http/Middleware/TrustHosts.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the host patterns that should be trusted.
|
||||
*
|
||||
* @return array<int, string|null>
|
||||
*/
|
||||
public function hosts()
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
}
|
||||
}
|
28
app/Http/Middleware/TrustProxies.php
Normal file
28
app/Http/Middleware/TrustProxies.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array<int, string>|string|null
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
22
app/Http/Middleware/ValidateSignature.php
Normal file
22
app/Http/Middleware/ValidateSignature.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
|
||||
|
||||
class ValidateSignature extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the query string parameters that should be ignored.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
// 'fbclid',
|
||||
// 'utm_campaign',
|
||||
// 'utm_content',
|
||||
// 'utm_medium',
|
||||
// 'utm_source',
|
||||
// 'utm_term',
|
||||
];
|
||||
}
|
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
30
app/Providers/AppServiceProvider.php
Normal file
30
app/Providers/AppServiceProvider.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// Update defaultStringLength
|
||||
Builder::defaultStringLength(191);
|
||||
}
|
||||
}
|
27
app/Providers/AuthServiceProvider.php
Normal file
27
app/Providers/AuthServiceProvider.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
// use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The model to policy mappings for the application.
|
||||
*
|
||||
* @var array<class-string, class-string>
|
||||
*/
|
||||
protected $policies = [// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
21
app/Providers/BroadcastServiceProvider.php
Normal file
21
app/Providers/BroadcastServiceProvider.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
42
app/Providers/EventServiceProvider.php
Normal file
42
app/Providers/EventServiceProvider.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event to listener mappings for the application.
|
||||
*
|
||||
* @var array<class-string, array<int, class-string>>
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if events and listeners should be automatically discovered.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldDiscoverEvents()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
31
app/Providers/HelperServiceProvider.php
Normal file
31
app/Providers/HelperServiceProvider.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class HelperServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$helperFiles = glob(app_path('Helpers').'/*.php');
|
||||
foreach ($helperFiles as $file) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
52
app/Providers/RouteServiceProvider.php
Normal file
52
app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
*
|
||||
* Typically, users are redirected here after authentication.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/dashboard';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, and other route configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->configureRateLimiting();
|
||||
|
||||
$this->routes(function () {
|
||||
Route::middleware('api')
|
||||
->prefix('api')
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->group(base_path('routes/web.php'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the rate limiters for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureRateLimiting()
|
||||
{
|
||||
RateLimiter::for('api', function (Request $request) {
|
||||
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
||||
});
|
||||
}
|
||||
}
|
29
app/View/Components/AuthLayout.php
Normal file
29
app/View/Components/AuthLayout.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class AuthLayout extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Init layout file
|
||||
app(config('settings.KT_THEME_BOOTSTRAP.auth'))->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represents the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view(config('settings.KT_THEME_LAYOUT_DIR').'._auth');
|
||||
}
|
||||
}
|
30
app/View/Components/DefaultLayout.php
Normal file
30
app/View/Components/DefaultLayout.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class DefaultLayout extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Init layout file
|
||||
app(config('settings.KT_THEME_BOOTSTRAP.default'))->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Closure|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
// See also starterkit/app/Core/Bootstrap/BootstrapDefault.php
|
||||
return view(config('settings.KT_THEME_LAYOUT_DIR').'._default');
|
||||
}
|
||||
}
|
30
app/View/Components/SystemLayout.php
Normal file
30
app/View/Components/SystemLayout.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class SystemLayout extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Init layout file
|
||||
app(config('settings.KT_THEME_BOOTSTRAP.system'))->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represents the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view(config('settings.KT_THEME_LAYOUT_DIR').'._system');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user