Add Setting Migration dan module qrcode

This commit is contained in:
Daeng Deni Mardaeni 2023-05-25 10:49:46 +07:00
parent 19001d8530
commit 0ab8abda5f
4 changed files with 342 additions and 209 deletions

View File

@ -24,6 +24,7 @@
"putrakuningan/cetaklabel-module": "dev-master",
"putrakuningan/logs-module": "^1.0",
"putrakuningan/usermanager-module": "dev-master",
"simplesoftwareio/simple-qrcode": "^4.2",
"spatie/laravel-activitylog": "^4.7",
"spatie/laravel-permission": "^5.10",
"wildside/userstamps": "^2.3",

View File

@ -1,237 +1,310 @@
<?php
return [
use App\Core\Bootstrap\BootstrapAuth;
use App\Core\Bootstrap\BootstrapDefault;
use App\Core\Bootstrap\BootstrapSystem;
'KT_THEME_BOOTSTRAP' => [
'default' => \App\Core\Bootstrap\BootstrapDefault::class,
'auth' => \App\Core\Bootstrap\BootstrapAuth::class,
'system' => \App\Core\Bootstrap\BootstrapSystem::class,
],
return [
'KT_THEME' => 'metronic',
'KT_THEME_BOOTSTRAP' => [
'default' => BootstrapDefault::class,
'auth' => BootstrapAuth::class,
'system' => BootstrapSystem::class,
],
# Theme layout templates directory
'KT_THEME' => 'metronic',
'KT_THEME_LAYOUT_DIR' => 'layout',
# Theme layout templates directory
'KT_THEME_LAYOUT_DIR' => 'layout',
# Theme Mode
# Value: light | dark | system
# Theme Mode
# Value: light | dark | system
'KT_THEME_MODE_DEFAULT' => 'light',
'KT_THEME_MODE_SWITCH_ENABLED' => true,
'KT_THEME_MODE_DEFAULT' => 'light',
'KT_THEME_MODE_SWITCH_ENABLED' => true,
# Theme Direction
# Value: ltr | rtl
# Theme Direction
# Value: ltr | rtl
'KT_THEME_DIRECTION' => 'ltr',
'KT_THEME_DIRECTION' => 'ltr',
# Keenicons
# Value: duotone | outline | bold
# Keenicons
# Value: duotone | outline | bold
'KT_THEME_ICONS' => 'duotone',
'KT_THEME_ICONS' => 'duotone',
# Theme Assets
# Theme Assets
'KT_THEME_ASSETS' => [
'favicon' => 'assets/media/logos/favicon.ico',
'fonts' => [
'https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700',
],
'global' => [
'css' => [
'assets/plugins/global/plugins.bundle.css',
'assets/css/style.bundle.css',
'KT_THEME_ASSETS' => [
'favicon' => 'assets/media/logos/favicon.ico',
'fonts' => [
'https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700',
],
'js' => [
'assets/plugins/global/plugins.bundle.js',
'assets/js/scripts.bundle.js',
'assets/js/widgets.bundle.js',
'global' => [
'css' => [
'assets/plugins/global/plugins.bundle.css',
'assets/css/style.bundle.css',
],
'js' => [
'assets/plugins/global/plugins.bundle.js',
'assets/js/scripts.bundle.js',
'assets/js/widgets.bundle.js',
],
],
],
],
# Theme Vendors
# Theme Vendors
'KT_THEME_VENDORS' => [
'datatables' => [
'css' => [
'assets/plugins/custom/datatables/datatables.bundle.css',
'KT_THEME_VENDORS' => [
'datatables' => [
'css' => [
'assets/plugins/custom/datatables/datatables.bundle.css',
],
'js' => [
'assets/plugins/custom/datatables/datatables.bundle.js',
],
],
'js' => [
'assets/plugins/custom/datatables/datatables.bundle.js',
'formrepeater' => [
'js' => [
'assets/plugins/custom/formrepeater/formrepeater.bundle.js',
],
],
'fullcalendar' => [
'css' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.css',
],
'js' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.js',
],
],
'flotcharts' => [
'js' => [
'assets/plugins/custom/flotcharts/flotcharts.bundle.js',
],
],
'google-jsapi' => [
'js' => [
'//www.google.com/jsapi',
],
],
'tinymce' => [
'js' => [
'assets/plugins/custom/tinymce/tinymce.bundle.js',
],
],
'ckeditor-classic' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js',
],
],
'ckeditor-inline' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-inline.bundle.js',
],
],
'ckeditor-balloon' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon.bundle.js',
],
],
'ckeditor-balloon-block' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon-block.bundle.js',
],
],
'ckeditor-document' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-document.bundle.js',
],
],
'draggable' => [
'js' => [
'assets/plugins/custom/draggable/draggable.bundle.js',
],
],
'fslightbox' => [
'js' => [
'assets/plugins/custom/fslightbox/fslightbox.bundle.js',
],
],
'jkanban' => [
'css' => [
'assets/plugins/custom/jkanban/jkanban.bundle.css',
],
'js' => [
'assets/plugins/custom/jkanban/jkanban.bundle.js',
],
],
'typedjs' => [
'js' => [
'assets/plugins/custom/typedjs/typedjs.bundle.js',
],
],
'cookiealert' => [
'css' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.css',
],
'js' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.js',
],
],
'cropper' => [
'css' => [
'assets/plugins/custom/cropper/cropper.bundle.css',
],
'js' => [
'assets/plugins/custom/cropper/cropper.bundle.js',
],
],
'vis-timeline' => [
'css' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.css',
],
'js' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.js',
],
],
'jstree' => [
'css' => [
'assets/plugins/custom/jstree/jstree.bundle.css',
],
'js' => [
'assets/plugins/custom/jstree/jstree.bundle.js',
],
],
'prismjs' => [
'css' => [
'assets/plugins/custom/prismjs/prismjs.bundle.css',
],
'js' => [
'assets/plugins/custom/prismjs/prismjs.bundle.js',
],
],
'leaflet' => [
'css' => [
'assets/plugins/custom/leaflet/leaflet.bundle.css',
],
'js' => [
'assets/plugins/custom/leaflet/leaflet.bundle.js',
],
],
'amcharts' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/percent.js',
'https://cdn.amcharts.com/lib/5/radar.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-maps' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/map.js',
'https://cdn.amcharts.com/lib/5/geodata/worldLow.js',
'https://cdn.amcharts.com/lib/5/geodata/continentsLow.js',
'https://cdn.amcharts.com/lib/5/geodata/usaLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZonesLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZoneAreasLow.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-stock' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'bootstrap-select' => [
'css' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.css',
],
'js' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.js',
],
],
'chained-select' => [
'js' => [
'assets/plugins/custom/jquery-chained/jquery.chained.js',
'assets/plugins/custom/jquery-chained/jquery.chained.remote.js',
],
],
],
'formrepeater' => [
'js' => [
'assets/plugins/custom/formrepeater/formrepeater.bundle.js',
],
],
'fullcalendar' => [
'css' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.css',
],
'js' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.js',
],
],
'flotcharts' => [
'js' => [
'assets/plugins/custom/flotcharts/flotcharts.bundle.js',
],
],
'google-jsapi' => [
'js' => [
'//www.google.com/jsapi',
],
],
'tinymce' => [
'js' => [
'assets/plugins/custom/tinymce/tinymce.bundle.js',
],
],
'ckeditor-classic' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js',
],
],
'ckeditor-inline' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-inline.bundle.js',
],
],
'ckeditor-balloon' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon.bundle.js',
],
],
'ckeditor-balloon-block' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon-block.bundle.js',
],
],
'ckeditor-document' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-document.bundle.js',
],
],
'draggable' => [
'js' => [
'assets/plugins/custom/draggable/draggable.bundle.js',
],
],
'fslightbox' => [
'js' => [
'assets/plugins/custom/fslightbox/fslightbox.bundle.js',
],
],
'jkanban' => [
'css' => [
'assets/plugins/custom/jkanban/jkanban.bundle.css',
],
'js' => [
'assets/plugins/custom/jkanban/jkanban.bundle.js',
],
],
'typedjs' => [
'js' => [
'assets/plugins/custom/typedjs/typedjs.bundle.js',
],
],
'cookiealert' => [
'css' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.css',
],
'js' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.js',
],
],
'cropper' => [
'css' => [
'assets/plugins/custom/cropper/cropper.bundle.css',
],
'js' => [
'assets/plugins/custom/cropper/cropper.bundle.js',
],
],
'vis-timeline' => [
'css' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.css',
],
'js' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.js',
],
],
'jstree' => [
'css' => [
'assets/plugins/custom/jstree/jstree.bundle.css',
],
'js' => [
'assets/plugins/custom/jstree/jstree.bundle.js',
],
],
'prismjs' => [
'css' => [
'assets/plugins/custom/prismjs/prismjs.bundle.css',
],
'js' => [
'assets/plugins/custom/prismjs/prismjs.bundle.js',
],
],
'leaflet' => [
'css' => [
'assets/plugins/custom/leaflet/leaflet.bundle.css',
],
'js' => [
'assets/plugins/custom/leaflet/leaflet.bundle.js',
],
],
'amcharts' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/percent.js',
'https://cdn.amcharts.com/lib/5/radar.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-maps' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/map.js',
'https://cdn.amcharts.com/lib/5/geodata/worldLow.js',
'https://cdn.amcharts.com/lib/5/geodata/continentsLow.js',
'https://cdn.amcharts.com/lib/5/geodata/usaLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZonesLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZoneAreasLow.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-stock' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'bootstrap-select' => [
'css' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.css',
],
'js' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.js',
],
],
'chained-select' => [
'js' => [
'assets/plugins/custom/jquery-chained/jquery.chained.js',
'assets/plugins/custom/jquery-chained/jquery.chained.remote.js',
],
],
],
/*
|--------------------------------------------------------------------------
| Default Settings Store
|--------------------------------------------------------------------------
|
| This option controls the default settings store that gets used while
| using this settings library.
|
| Supported: "json", "database"
|
*/
'store' => 'database',
];
/*
|--------------------------------------------------------------------------
| JSON Store
|--------------------------------------------------------------------------
|
| If the store is set to "json", settings are stored in the defined
| file path in JSON format. Use full path to file.
|
*/
'path' => storage_path() . '/settings.json',
/*
|--------------------------------------------------------------------------
| Database Store
|--------------------------------------------------------------------------
|
| The settings are stored in the defined file path in JSON format.
| Use full path to JSON file.
|
*/
// If set to null, the default connection will be used.
'connection' => null,
// Name of the table used.
'table' => 'settings',
// If you want to use custom column names in database store you could
// set them in this configuration
'keyColumn' => 'key',
'valueColumn' => 'value',
/*
|--------------------------------------------------------------------------
| Cache settings
|--------------------------------------------------------------------------
|
| If you want all setting calls to go through Laravel's cache system.
|
*/
'enableCache' => false,
// Whether to reset the cache when changing a setting.
'forgetCacheByWrite' => true,
// TTL in seconds.
'cacheTtl' => 15,
/*
|--------------------------------------------------------------------------
| Default Settings
|--------------------------------------------------------------------------
|
| Define all default settings that will be used before any settings are set,
| this avoids all settings being set to false to begin with and avoids
| hardcoding the same defaults in all 'Settings::get()' calls
|
*/
'defaults' => [
'foo' => 'bar',
]
];

View File

@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Config;
class CreateSettingsTable extends Migration
{
public function __construct()
{
if (version_compare(Application::VERSION, '5.0', '>=')) {
$this->tablename = Config::get('settings.table');
$this->keyColumn = Config::get('settings.keyColumn');
$this->valueColumn = Config::get('settings.valueColumn');
} else {
$this->tablename = Config::get('anlutro/l4-settings::table');
$this->keyColumn = Config::get('anlutro/l4-settings::keyColumn');
$this->valueColumn = Config::get('anlutro/l4-settings::valueColumn');
}
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create($this->tablename, function(Blueprint $table)
{
$table->increments('id');
$table->string($this->keyColumn)->index();
$table->text($this->valueColumn);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop($this->tablename);
}
}

View File

@ -308,6 +308,7 @@
</div>
<!--end:Menu item-->
<!--begin:Menu item-->
<div class="menu-item pt-5">
<!--begin:Menu content-->
@ -318,6 +319,17 @@
</div>
<!--end:Menu item-->
<!--begin:Menu item-->
<div class="menu-item {{ $route[0] == "settings" ? "here" : "" }}">
<!--begin:Menu link-->
<a class="menu-link {{ $route[0] == "settings" ? "active" : "" }}" href="{{ route('settings.index') }}">
<span class="menu-icon">{!! getIcon('setting-4', 'fs-2','duotone') !!}</span>
<span class="menu-title">Setting Parameter</span>
</a>
<!--end:Menu link-->
</div>
<!--end:Menu item-->
<!--begin:Menu item-->
<div data-kt-menu-trigger="click" class="menu-item menu-accordion {{ $route[0] == 'log' ? 'show' : '' }}">
<!--begin:Menu link-->