├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Console │ ├── Commands │ │ ├── DeployUiCommand.php │ │ └── GeneratorCommand.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── API │ │ │ ├── AuthenticateController.php │ │ │ ├── MetasController.php │ │ │ ├── NotificationsController.php │ │ │ ├── PermissionsController.php │ │ │ ├── RoleGroupsController.php │ │ │ ├── RolePermissionsController.php │ │ │ ├── RolesController.php │ │ │ ├── UserNotificationsController.php │ │ │ └── UsersController.php │ │ ├── Controller.php │ │ └── GlobalController.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ ├── ValidateSignature.php │ │ └── VerifyCsrfToken.php ├── Models │ ├── Metas.php │ ├── Metas_H.php │ ├── Notifications.php │ ├── Notifications_H.php │ ├── Permissions.php │ ├── Permissions_H.php │ ├── RoleGroups.php │ ├── RoleGroups_H.php │ ├── RolePermissions.php │ ├── RolePermissions_H.php │ ├── Roles.php │ ├── Roles_H.php │ ├── UserNotifications.php │ ├── UserNotifications_H.php │ ├── Users.php │ └── Users_H.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Repositories │ ├── MetasRepository.php │ ├── NotificationsRepository.php │ ├── PermissionsRepository.php │ ├── RoleGroupsRepository.php │ ├── RolePermissionsRepository.php │ ├── RolesRepository.php │ ├── UserNotificationsRepository.php │ └── UsersRepository.php ├── Services │ ├── ApplicationSettings.php │ ├── ModuleGenerator.php │ ├── Notify.php │ └── Uploader.php ├── Traits │ ├── StandardModel.php │ └── StandardRepo.php └── helpers.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── lv_menu.php ├── lv_modules.php ├── lv_settings.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UsersFactory.php ├── migrations │ ├── 2012_08_14_000001_create_failed_jobs_table.php │ ├── 2012_08_14_000001_create_password_reset_tokens_table.php │ ├── 2012_08_14_000001_create_password_resets_table.php │ ├── 2022_08_14_112406_metas_init.php │ ├── 2022_08_14_112406_notifications_init.php │ ├── 2022_08_14_112406_permissions_init.php │ ├── 2022_08_14_112406_role_groups_init.php │ ├── 2022_08_14_112406_role_permissions_init.php │ ├── 2022_08_14_112406_roles_init.php │ ├── 2022_08_14_112406_user_notifications_init.php │ └── 2022_08_14_112406_users_init.php └── seeders │ └── DatabaseSeeder.php ├── generator ├── scopes │ └── base.json └── template │ ├── api │ ├── Controller.lvt │ ├── Migration.lvt │ ├── Model.lvt │ ├── Model_H.lvt │ └── Repository.lvt │ ├── requirement.lvt │ └── ui │ ├── Detail.lvt │ ├── Form.lvt │ ├── Index.lvt │ └── Meta.lvt ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── global │ └── images │ │ ├── 404.png │ │ ├── icon.png │ │ ├── logo-light.png │ │ └── logo.png ├── index.php └── robots.txt ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js └── views │ ├── errors │ ├── 401.blade.php │ ├── 403.blade.php │ └── 404.blade.php │ └── frontend.blade.php ├── routes ├── api.php ├── channels.php ├── console.php ├── ui_route.json ├── ui_route.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── ui ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── .vscode │ ├── extensions.json │ └── settings.json ├── README.md ├── babel.config.js ├── jsconfig.json ├── package-lock.json ├── package.json ├── public │ ├── assets │ │ ├── icon.png │ │ ├── images │ │ │ └── grettings.png │ │ ├── logo-light.png │ │ ├── logo.png │ │ ├── manifest.json │ │ ├── noimg.png │ │ └── pattern-1.jpg │ └── icons │ │ ├── favicon-128x128.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ └── favicon.ico ├── quasar.conf.js └── src │ ├── App.vue │ ├── Config.js │ ├── assets │ └── quasar-logo-vertical.svg │ ├── boot │ ├── .gitkeep │ ├── axios.js │ └── extends.js │ ├── components │ ├── core │ │ ├── Echo.vue │ │ ├── Notif.vue │ │ ├── NotificationList.vue │ │ ├── ProfilePopup.vue │ │ ├── SideNav.vue │ │ ├── SideNavList.vue │ │ ├── SideNavListItem.vue │ │ ├── TopBar.vue │ │ ├── TopMenus.vue │ │ ├── TopNav.vue │ │ └── TopNavList.vue │ ├── globals │ │ ├── ForbiddenPage.vue │ │ └── UnauthorizePage.vue │ └── lavux │ │ ├── LvActionBox.vue │ │ ├── LvActionItem.vue │ │ ├── LvBanner.vue │ │ ├── LvBreadcumb.vue │ │ ├── LvBtn.vue │ │ ├── LvCheckbox.vue │ │ ├── LvContainer.vue │ │ ├── LvDisplayer.vue │ │ ├── LvHeaderPage.vue │ │ ├── LvInput.vue │ │ ├── LvInputTags.vue │ │ ├── LvLink.vue │ │ ├── LvLoading.vue │ │ ├── LvLogData.vue │ │ ├── LvOpenLink.vue │ │ ├── LvSegment.vue │ │ ├── LvSelect.vue │ │ ├── LvTable.vue │ │ ├── LvTableSetting.vue │ │ ├── LvText.vue │ │ ├── LvTextarea.vue │ │ ├── LvThead.vue │ │ ├── LvToggle.vue │ │ ├── LvUploader.vue │ │ ├── LvUser.vue │ │ └── LvViewItem.vue │ ├── composables │ └── Services.js │ ├── css │ ├── app.scss │ ├── quasar.variables.scss │ └── theme.scss │ ├── index.template.html │ ├── layouts │ ├── Login.vue │ └── MainLayout.vue │ ├── pages │ ├── Error401.vue │ ├── Error403.vue │ ├── Error404.vue │ ├── Index.vue │ ├── accounts │ │ ├── change-password.vue │ │ ├── notifications.vue │ │ ├── send-notification.vue │ │ └── update-profile.vue │ ├── example.vue │ ├── generator.vue │ ├── metas │ │ ├── detail.vue │ │ ├── form.vue │ │ ├── index.vue │ │ └── meta.js │ ├── permissions │ │ ├── detail.vue │ │ ├── form.vue │ │ ├── index.vue │ │ └── meta.js │ ├── role-groups │ │ ├── detail.vue │ │ ├── form.vue │ │ ├── index.vue │ │ └── meta.js │ ├── roles │ │ ├── detail.vue │ │ ├── form.vue │ │ ├── index.vue │ │ └── meta.js │ ├── settings.vue │ └── users │ │ ├── detail.vue │ │ ├── form.vue │ │ ├── index.vue │ │ └── meta.js │ ├── quasar.d.ts │ ├── router │ ├── index.js │ └── routes.js │ ├── services │ ├── Api.js │ ├── BuildRoute.js │ ├── Handler.js │ └── Helper.js │ └── store │ └── GlobalStore.js └── vite.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=laravel 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DISK=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=file 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailpit 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS="hello@example.com" 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_HOST= 50 | PUSHER_PORT=443 51 | PUSHER_SCHEME=https 52 | PUSHER_APP_CLUSTER=mt1 53 | 54 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 55 | VITE_PUSHER_HOST="${PUSHER_HOST}" 56 | VITE_PUSHER_PORT="${PUSHER_PORT}" 57 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 58 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 59 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache 2 | /node_modules 3 | /public/build 4 | /public/hot 5 | /public/storage 6 | /public/assets 7 | /public/css 8 | /public/fonts 9 | /public/icons 10 | /public/img 11 | /public/js 12 | /public/app.html 13 | /generator/output 14 | /storage/*.key 15 | /vendor 16 | .env 17 | .env.backup 18 | .env.production 19 | .phpunit.result.cache 20 | Homestead.json 21 | Homestead.yaml 22 | auth.json 23 | npm-debug.log 24 | yarn-error.log 25 | /.fleet 26 | /.idea 27 | /.vscode 28 | -------------------------------------------------------------------------------- /app/Console/Commands/GeneratorCommand.php: -------------------------------------------------------------------------------- 1 | option('scope') ?? $this->option('s'); 32 | ModuleGenerator::generate($this, $scope); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 16 | } 17 | 18 | /** 19 | * Register the commands for the application. 20 | */ 21 | protected function commands(): void 22 | { 23 | $this->load(__DIR__.'/Commands'); 24 | 25 | require base_path('routes/console.php'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed to the session on validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | */ 42 | public function register(): void 43 | { 44 | $this->reportable(function (Throwable $e) { 45 | // 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 43 | \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's middleware aliases. 50 | * 51 | * Aliases may be used to conveniently assign middleware to routes and groups. 52 | * 53 | * @var array 54 | */ 55 | protected $middlewareAliases = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'signed' => \App\Http\Middleware\ValidateSignature::class, 64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 66 | ]; 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 16 | $fromAPI = $request->is('api/*'); 17 | if ($fromAPI) return route('unauthorized'); 18 | else return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 24 | return redirect(RouteServiceProvider::HOME); 25 | } 26 | } 27 | 28 | return $next($request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts(): array 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Models/Metas.php: -------------------------------------------------------------------------------- 1 | 'string', 44 | 'slug'=> 'string', 45 | 'name'=> 'string', 46 | 'value'=> 'string', 47 | 'description'=> 'string', 48 | 'remarks'=> 'string' 49 | ]; 50 | 51 | // automatic appends attributes 52 | protected $appends = [ 53 | 'log_data' // default log data, from StandardModel 54 | // 'your_attr' 55 | ]; 56 | 57 | /** Search Relations 58 | * for availability searching by relation data, needed in StandardRepo 59 | */ 60 | public function searchRelations() { 61 | try { 62 | return $this->bindSearchRelation([ 63 | 64 | ]); 65 | } catch (\Exception $e){ 66 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 67 | } 68 | } 69 | 70 | /* Relations : belongsTo */ 71 | 72 | 73 | 74 | /* Relations : hasMany */ 75 | 76 | 77 | 78 | /* Relations : morphTo */ 79 | 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /app/Models/Metas_H.php: -------------------------------------------------------------------------------- 1 | filterListBase() */ 15 | public function filterList () { 16 | $overide = [ 17 | 18 | [ 19 | 'id' => 'id', 20 | 'type' => 'input', 21 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('bigIncrements')), 22 | ], 23 | [ 24 | 'id' => 'type', 25 | 'type' => 'select', 26 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('enum')), 27 | 'options' => $this->EnumType(), 28 | ], 29 | [ 30 | 'id' => 'slug', 31 | 'type' => 'input', 32 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 33 | ], 34 | [ 35 | 'id' => 'name', 36 | 'type' => 'input', 37 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 38 | ], 39 | [ 40 | 'id' => 'value', 41 | 'type' => 'input', 42 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('text')), 43 | ], 44 | [ 45 | 'id' => 'description', 46 | 'type' => 'input', 47 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('text')), 48 | ], 49 | [ 50 | 'id' => 'remarks', 51 | 'type' => 'input', 52 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('text')), 53 | ], 54 | ]; 55 | $res = $this->mergeFilterList( 56 | $this->filterListBase(), // from "app/Traits/StandardModel" 57 | $overide // you can overide previous value into real value you need 58 | ); 59 | return $res; 60 | 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /app/Models/Notifications.php: -------------------------------------------------------------------------------- 1 | 'string', 50 | 'content'=> 'string', 51 | 'type'=> 'string', 52 | 'category'=> 'string', 53 | 'link_source'=> 'string', 54 | 'link_url'=> 'string', 55 | 'date'=> 'string', 56 | ]; 57 | 58 | // automatic appends attributes 59 | protected $appends = [ 60 | // 'log_data', // default log data, from StandardModel 61 | 'link' 62 | ]; 63 | 64 | /** Search Relations 65 | * for availability searching by relation data, needed in StandardRepo 66 | */ 67 | public function searchRelations() { 68 | try { 69 | return $this->bindSearchRelation([ 70 | 71 | ]); 72 | } catch (\Exception $e){ 73 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 74 | } 75 | } 76 | 77 | public function getLinkAttribute ($data = null) { 78 | $res = null; 79 | 80 | $link_source = $this->link_source; 81 | $link_url = $this->link_url; 82 | 83 | if ($res) return $res; 84 | else { 85 | if ($link_source == 'api') return env("API_URL").$link_url; 86 | elseif ($link_source == 'frontend') return env("UI_URL").$link_url; 87 | else return $link_url; 88 | } 89 | 90 | } 91 | 92 | /* Relations : belongsTo */ 93 | 94 | 95 | 96 | /* Relations : hasMany */ 97 | 98 | 99 | 100 | /* Relations : morphTo */ 101 | 102 | 103 | 104 | } 105 | -------------------------------------------------------------------------------- /app/Models/Notifications_H.php: -------------------------------------------------------------------------------- 1 | filterListBase() */ 18 | public function filterList () { 19 | $overide = [ 20 | 21 | [ 22 | 'id' => 'id', 23 | 'type' => 'input', 24 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('bigIncrements')), 25 | ], 26 | [ 27 | 'id' => 'title', 28 | 'type' => 'input', 29 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 30 | ], 31 | [ 32 | 'id' => 'content', 33 | 'type' => 'input', 34 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('longtext')), 35 | ], 36 | [ 37 | 'id' => 'type', 38 | 'type' => 'select', 39 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('enum')), 40 | 'options' => $this->EnumType(), 41 | ], 42 | [ 43 | 'id' => 'category', 44 | 'type' => 'input', 45 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 46 | ], 47 | [ 48 | 'id' => 'link_source', 49 | 'type' => 'select', 50 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('enum')), 51 | 'options' => $this->EnumLinkSource(), 52 | ], 53 | [ 54 | 'id' => 'link_url', 55 | 'type' => 'input', 56 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 57 | ], 58 | [ 59 | 'id' => 'date', 60 | 'type' => 'input', 61 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('dateTime')), 62 | ], 63 | ]; 64 | $res = $this->mergeFilterList( 65 | $this->filterListBase(), // from "app/Traits/StandardModel" 66 | $overide // you can overide previous value into real value you need 67 | ); 68 | return $res; 69 | 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /app/Models/Permissions.php: -------------------------------------------------------------------------------- 1 | 'string', 36 | 'name'=> 'string' 37 | ]; 38 | 39 | // automatic appends attributes 40 | protected $appends = [ 41 | 'log_data' // default log data, from StandardModel 42 | // 'your_attr' 43 | ]; 44 | 45 | /** Search Relations 46 | * for availability searching by relation data, needed in StandardRepo 47 | */ 48 | public function searchRelations() { 49 | try { 50 | return $this->bindSearchRelation([ 51 | 52 | ]); 53 | } catch (\Exception $e){ 54 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 55 | } 56 | } 57 | 58 | /* Relations : belongsTo */ 59 | 60 | 61 | 62 | /* Relations : hasMany */ 63 | 64 | 65 | 66 | /* Relations : morphTo */ 67 | 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /app/Models/Permissions_H.php: -------------------------------------------------------------------------------- 1 | filterListBase() */ 12 | public function filterList () { 13 | $overide = [ 14 | 15 | [ 16 | 'id' => 'id', 17 | 'type' => 'input', 18 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('bigIncrements')), 19 | ], 20 | [ 21 | 'id' => 'module', 22 | 'type' => 'input', 23 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 24 | ], 25 | [ 26 | 'id' => 'name', 27 | 'type' => 'input', 28 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 29 | ], 30 | ]; 31 | $res = $this->mergeFilterList( 32 | $this->filterListBase(), // from "app/Traits/StandardModel" 33 | $overide // you can overide previous value into real value you need 34 | ); 35 | return $res; 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/Models/RoleGroups.php: -------------------------------------------------------------------------------- 1 | 'string' 34 | ]; 35 | 36 | // automatic appends attributes 37 | protected $appends = [ 38 | 'log_data' // default log data, from StandardModel 39 | // 'your_attr' 40 | ]; 41 | 42 | /** Search Relations 43 | * for availability searching by relation data, needed in StandardRepo 44 | */ 45 | public function searchRelations() { 46 | try { 47 | return $this->bindSearchRelation([ 48 | 49 | ]); 50 | } catch (\Exception $e){ 51 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 52 | } 53 | } 54 | 55 | /* Relations : belongsTo */ 56 | 57 | 58 | 59 | /* Relations : hasMany */ 60 | 61 | 62 | 63 | /* Relations : morphTo */ 64 | 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /app/Models/RoleGroups_H.php: -------------------------------------------------------------------------------- 1 | filterListBase() */ 12 | public function filterList () { 13 | $overide = [ 14 | 15 | [ 16 | 'id' => 'id', 17 | 'type' => 'input', 18 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('bigIncrements')), 19 | ], 20 | [ 21 | 'id' => 'name', 22 | 'type' => 'input', 23 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 24 | ], 25 | ]; 26 | $res = $this->mergeFilterList( 27 | $this->filterListBase(), // from "app/Traits/StandardModel" 28 | $overide // you can overide previous value into real value you need 29 | ); 30 | return $res; 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/Models/RolePermissions.php: -------------------------------------------------------------------------------- 1 | 'integer', 36 | 'role_id'=> 'integer' 37 | ]; 38 | 39 | // automatic appends attributes 40 | protected $appends = [ 41 | 'log_data' // default log data, from StandardModel 42 | // 'your_attr' 43 | ]; 44 | 45 | /** Search Relations 46 | * for availability searching by relation data, needed in StandardRepo 47 | */ 48 | public function searchRelations() { 49 | try { 50 | return $this->bindSearchRelation([ 51 | 'Permission' => 'Permissions', 52 | 'Role' => 'Roles', 53 | 54 | ]); 55 | } catch (\Exception $e){ 56 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 57 | } 58 | } 59 | 60 | /* Relations : belongsTo */ 61 | 62 | public function Permission() { 63 | return $this->belongsTo(Permissions::class, 'permission_id', 'id')->withTrashed(); 64 | } 65 | 66 | public function Role() { 67 | return $this->belongsTo(Roles::class, 'role_id', 'id')->withTrashed(); 68 | } 69 | 70 | 71 | 72 | /* Relations : hasMany */ 73 | 74 | 75 | 76 | /* Relations : morphTo */ 77 | 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /app/Models/RolePermissions_H.php: -------------------------------------------------------------------------------- 1 | filterListBase() */ 12 | public function filterList () { 13 | $overide = [ 14 | 15 | [ 16 | 'id' => 'id', 17 | 'type' => 'input', 18 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('bigIncrements')), 19 | ], 20 | [ 21 | 'id' => 'permission_id', 22 | 'type' => 'select', 23 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('unsignedBigInteger')), 24 | 'sources' => 'permissions', 25 | 'key_value' => 'id', 26 | 'key_label' => 'id', 27 | ], 28 | [ 29 | 'id' => 'role_id', 30 | 'type' => 'select', 31 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('unsignedBigInteger')), 32 | 'sources' => 'roles', 33 | 'key_value' => 'id', 34 | 'key_label' => 'id', 35 | ], 36 | ]; 37 | $res = $this->mergeFilterList( 38 | $this->filterListBase(), // from "app/Traits/StandardModel" 39 | $overide // you can overide previous value into real value you need 40 | ); 41 | return $res; 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /app/Models/Roles.php: -------------------------------------------------------------------------------- 1 | 'integer', 38 | 'name'=> 'string', 39 | 'slug'=> 'string' 40 | ]; 41 | 42 | // automatic appends attributes 43 | protected $appends = [ 44 | 'log_data' // default log data, from StandardModel 45 | // 'your_attr' 46 | ]; 47 | 48 | /** Search Relations 49 | * for availability searching by relation data, needed in StandardRepo 50 | */ 51 | public function searchRelations() { 52 | try { 53 | return $this->bindSearchRelation([ 54 | 'RoleGroup' => 'RoleGroups', 55 | 56 | ]); 57 | } catch (\Exception $e){ 58 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 59 | } 60 | } 61 | 62 | /* Relations : belongsTo */ 63 | 64 | public function RoleGroup() { 65 | return $this->belongsTo(RoleGroups::class, 'role_group_id', 'id')->withTrashed(); 66 | } 67 | 68 | 69 | 70 | /* Relations : hasMany */ 71 | 72 | 73 | 74 | /* Relations : morphTo */ 75 | 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/Models/Roles_H.php: -------------------------------------------------------------------------------- 1 | filterListBase() */ 12 | public function filterList () { 13 | $overide = [ 14 | 15 | [ 16 | 'id' => 'id', 17 | 'type' => 'input', 18 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('bigIncrements')), 19 | ], 20 | [ 21 | 'id' => 'role_group_id', 22 | 'type' => 'select', 23 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('unsignedBigInteger')), 24 | 'sources' => 'role-groups', 25 | 'key_value' => 'id', 26 | 'key_label' => 'id', 27 | ], 28 | [ 29 | 'id' => 'name', 30 | 'type' => 'input', 31 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 32 | ], 33 | [ 34 | 'id' => 'slug', 35 | 'type' => 'input', 36 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('string')), 37 | ], 38 | ]; 39 | $res = $this->mergeFilterList( 40 | $this->filterListBase(), // from "app/Traits/StandardModel" 41 | $overide // you can overide previous value into real value you need 42 | ); 43 | return $res; 44 | 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/Models/UserNotifications.php: -------------------------------------------------------------------------------- 1 | 'integer', 39 | 'is_read'=> 'boolean', 40 | 'notification_id'=> 'integer' 41 | ]; 42 | 43 | // automatic appends attributes 44 | protected $appends = [ 45 | 'log_data' // default log data, from StandardModel 46 | // 'your_attr' 47 | ]; 48 | 49 | /** Search Relations 50 | * for availability searching by relation data, needed in StandardRepo 51 | */ 52 | public function searchRelations() { 53 | try { 54 | return $this->bindSearchRelation([ 55 | 'User' => 'Users', 56 | 'Notification' => 'Notifications', 57 | 58 | ]); 59 | } catch (\Exception $e){ 60 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 61 | } 62 | } 63 | 64 | /* Relations : belongsTo */ 65 | 66 | public function User() { 67 | return $this->belongsTo(Users::class, 'user_id', 'id')->withTrashed(); 68 | } 69 | 70 | public function Notification() { 71 | return $this->belongsTo(Notifications::class, 'notification_id', 'id')->withTrashed(); 72 | } 73 | 74 | 75 | 76 | /* Relations : hasMany */ 77 | 78 | 79 | 80 | /* Relations : morphTo */ 81 | 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /app/Models/UserNotifications_H.php: -------------------------------------------------------------------------------- 1 | filterListBase() */ 12 | public function filterList () { 13 | $overide = [ 14 | 15 | [ 16 | 'id' => 'id', 17 | 'type' => 'input', 18 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('bigIncrements')), 19 | ], 20 | [ 21 | 'id' => 'user_id', 22 | 'type' => 'select', 23 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('unsignedBigInteger')), 24 | 'sources' => 'users', 25 | 'key_value' => 'id', 26 | 'key_label' => 'id', 27 | ], 28 | [ 29 | 'id' => 'is_read', 30 | 'type' => 'input', 31 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('boolean')), 32 | ], 33 | [ 34 | 'id' => 'notification_id', 35 | 'type' => 'select', 36 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('unsignedBigInteger')), 37 | 'sources' => 'notifications', 38 | 'key_value' => 'id', 39 | 'key_label' => 'id', 40 | ], 41 | ]; 42 | $res = $this->mergeFilterList( 43 | $this->filterListBase(), // from "app/Traits/StandardModel" 44 | $overide // you can overide previous value into real value you need 45 | ); 46 | return $res; 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/Models/Users.php: -------------------------------------------------------------------------------- 1 | 'string', 55 | 'username'=> 'string', 56 | 'password'=> 'string', 57 | 'email'=> 'string', 58 | 'email_verified_at'=> 'string', 59 | 'remember_token'=> 'string', 60 | 'picture'=> 'string', 61 | 'role_id'=> 'integer', 62 | 'is_ban'=> 'boolean' 63 | ]; 64 | 65 | // automatic appends attributes 66 | protected $appends = [ 67 | 'log_data' // log data, from StandardModel 68 | ]; 69 | 70 | /** Search Relations 71 | * for availability searching by relation data, needed in StandardRepo 72 | */ 73 | public function searchRelations() { 74 | try { 75 | return $this->bindSearchRelation([ 76 | 'Role' => 'Roles', 77 | ]); 78 | } catch (\Exception $e){ 79 | throw new \Exception(H_throw($e, '['.H_getModelName(get_class()).'::searchRelations]')); 80 | } 81 | } 82 | 83 | /* Relations */ 84 | 85 | public function Role() { 86 | return $this->belongsTo(Roles::class, 'role_id', 'id')->withTrashed(); 87 | } 88 | 89 | public function getRoleNameAttribute ($data = null) { 90 | try { 91 | $this->overideModelAttribute($this, $data); 92 | $res = $this->DB((new Roles)->getTable())->select('name')->whereId($this->role_id)->first(); 93 | return $res ? $res->name : $res; 94 | } catch (\Exception $e){ 95 | throw new \Exception(H_throw($e, '['.H_getModelName(get_class()).'::getRoleNameAttribute]')); 96 | } 97 | } 98 | 99 | 100 | } 101 | -------------------------------------------------------------------------------- /app/Models/Users_H.php: -------------------------------------------------------------------------------- 1 | DB('table') for make raw query 7 | */ 8 | trait Users_H { 9 | 10 | public function filterList () { 11 | $overide = [ 12 | [ 13 | 'id' => 'hobbies', 14 | 'name' => 'Hobbies', 15 | 'type' => 'select', 16 | 'operator' => H_getOperatorSearchList(H_filterTableOperatorDefault('json')), 17 | 'multiple' => true, 18 | ], 19 | ]; 20 | $res = $this->mergeFilterList( 21 | $this->filterListBase(), // from "app/Traits/StandardModel" 22 | $overide // you can overide previous value into real value you need 23 | ); 24 | return $res; 25 | 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind("App\Repositories\\{$module}Repository", "App\Repositories\\{$module}Repository"); 18 | } 19 | } 20 | 21 | /** 22 | * Bootstrap any application services. 23 | */ 24 | public function boot(): void 25 | { 26 | // 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | */ 22 | public function boot(): void 23 | { 24 | // 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | */ 26 | public function boot(): void 27 | { 28 | // 29 | } 30 | 31 | /** 32 | * Determine if events and listeners should be automatically discovered. 33 | */ 34 | public function shouldDiscoverEvents(): bool 35 | { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 28 | 29 | $this->routes(function () { 30 | Route::middleware('api') 31 | ->prefix('api') 32 | ->group(base_path('routes/api.php')); 33 | 34 | Route::middleware('web') 35 | ->group(base_path('routes/web.php')); 36 | }); 37 | } 38 | 39 | /** 40 | * Configure the rate limiters for the application. 41 | */ 42 | protected function configureRateLimiting(): void 43 | { 44 | RateLimiter::for('api', function (Request $request) { 45 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Repositories/MetasRepository.php: -------------------------------------------------------------------------------- 1 | request = $request; 23 | $this->model = $this->initModel(); 24 | } 25 | 26 | /** 27 | * Model initiate 28 | * @return object 29 | */ 30 | public function initModel($id = null) { 31 | $model = new Metas; 32 | if (!empty($id)) $model = $this->model->where($this->model->getKeyName(), $id)->first(); 33 | return $model; 34 | } 35 | 36 | public function store ($id = null, $customPayload = null) { 37 | try { 38 | $payload = $this->request->all(); 39 | if ($customPayload) $payload = $customPayload; 40 | $data = $this->initModel($id); 41 | 42 | $data->type = H_hasProps($payload, 'type', 'string'); 43 | $data->slug = H_hasProps($payload, 'slug'); 44 | $data->name = H_hasProps($payload, 'name'); 45 | $data->value = H_hasProps($payload, 'value'); 46 | $data->description = H_hasProps($payload, 'description'); 47 | $data->remarks = H_hasProps($payload, 'remarks'); 48 | 49 | $this->setLogHistory($data); 50 | 51 | $data->save(); 52 | return $data; 53 | } catch (Exception $e){ 54 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::store] ')); 55 | } 56 | } 57 | 58 | // Fetching, Delete & Restore functions there are in Traits/StandardRepo 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/Repositories/NotificationsRepository.php: -------------------------------------------------------------------------------- 1 | request = $request; 23 | $this->model = $this->initModel(); 24 | } 25 | 26 | /** 27 | * Model initiate 28 | * @return object 29 | */ 30 | public function initModel($id = null) { 31 | $model = new Notifications; 32 | if (!empty($id)) $model = $this->model->where($this->model->getKeyName(), $id)->first(); 33 | return $model; 34 | } 35 | 36 | public function store ($id = null, $customPayload = null) { 37 | try { 38 | $payload = $this->request->all(); 39 | if ($customPayload) $payload = $customPayload; 40 | $data = $this->initModel($id); 41 | 42 | $data->title = H_hasProps($payload, 'title'); 43 | $data->content = H_hasProps($payload, 'content'); 44 | $data->type = H_hasProps($payload, 'type', 'system'); 45 | $data->category = H_hasProps($payload, 'category'); 46 | $data->link_source = H_hasProps($payload, 'link_source', 'frontend'); 47 | $data->link_url = H_hasProps($payload, 'link_url'); 48 | $data->date = H_hasProps($payload, 'date'); 49 | 50 | $this->setLogHistory($data); 51 | 52 | $data->save(); 53 | return $data; 54 | } catch (Exception $e){ 55 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::store] ')); 56 | } 57 | } 58 | 59 | // Fetching, Delete & Restore functions there are in Traits/StandardRepo 60 | 61 | } 62 | -------------------------------------------------------------------------------- /app/Repositories/PermissionsRepository.php: -------------------------------------------------------------------------------- 1 | request = $request; 23 | $this->model = $this->initModel(); 24 | } 25 | 26 | /** 27 | * Model initiate 28 | * @return object 29 | */ 30 | public function initModel($id = null) { 31 | $model = new Permissions; 32 | if (!empty($id)) $model = $this->model->where($this->model->getKeyName(), $id)->first(); 33 | return $model; 34 | } 35 | 36 | public function store ($id = null, $customPayload = null) { 37 | try { 38 | $payload = $this->request->all(); 39 | if ($customPayload) $payload = $customPayload; 40 | $data = $this->initModel($id); 41 | 42 | $data->module = H_hasProps($payload, 'module'); 43 | $data->name = H_hasProps($payload, 'name'); 44 | 45 | $this->setLogHistory($data); 46 | 47 | $data->save(); 48 | return $data; 49 | } catch (Exception $e){ 50 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::store] ')); 51 | } 52 | } 53 | 54 | // Fetching, Delete & Restore functions there are in Traits/StandardRepo 55 | 56 | } 57 | -------------------------------------------------------------------------------- /app/Repositories/RoleGroupsRepository.php: -------------------------------------------------------------------------------- 1 | request = $request; 23 | $this->model = $this->initModel(); 24 | } 25 | 26 | /** 27 | * Model initiate 28 | * @return object 29 | */ 30 | public function initModel($id = null) { 31 | $model = new RoleGroups; 32 | if (!empty($id)) $model = $this->model->where($this->model->getKeyName(), $id)->first(); 33 | return $model; 34 | } 35 | 36 | public function store ($id = null, $customPayload = null) { 37 | try { 38 | $payload = $this->request->all(); 39 | if ($customPayload) $payload = $customPayload; 40 | $data = $this->initModel($id); 41 | 42 | $data->name = H_hasProps($payload, 'name'); 43 | 44 | $this->setLogHistory($data); 45 | 46 | $data->save(); 47 | return $data; 48 | } catch (Exception $e){ 49 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::store] ')); 50 | } 51 | } 52 | 53 | // Fetching, Delete & Restore functions there are in Traits/StandardRepo 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/Repositories/RolePermissionsRepository.php: -------------------------------------------------------------------------------- 1 | request = $request; 23 | $this->model = $this->initModel(); 24 | } 25 | 26 | /** 27 | * Model initiate 28 | * @return object 29 | */ 30 | public function initModel($id = null) { 31 | $model = new RolePermissions; 32 | if (!empty($id)) $model = $this->model->where($this->model->getKeyName(), $id)->first(); 33 | return $model; 34 | } 35 | 36 | public function store ($id = null, $customPayload = null) { 37 | try { 38 | $payload = $this->request->all(); 39 | if ($customPayload) $payload = $customPayload; 40 | $data = $this->initModel($id); 41 | 42 | $data->permission_id = H_hasProps($payload, 'permission_id'); 43 | $data->role_id = H_hasProps($payload, 'role_id'); 44 | 45 | $this->setLogHistory($data); 46 | 47 | $data->save(); 48 | return $data; 49 | } catch (Exception $e){ 50 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::store] ')); 51 | } 52 | } 53 | 54 | // Fetching, Delete & Restore functions there are in Traits/StandardRepo 55 | 56 | public function saveRolePermissions ($role, $details) { 57 | $saved = []; 58 | foreach ($details as $key => $permission) { 59 | if ($permission['current_allow'] != $permission['allow']) { 60 | $data = $this->prepareAndStore($role, $permission); 61 | $saved[] = $data; 62 | } 63 | } 64 | return $saved; 65 | } 66 | 67 | function prepareAndStore($role, $permission) { 68 | $data = [ 69 | "id" => $permission['id'], 70 | "permission_id" => $permission['permission_id'], 71 | "role_id" => $role['id'], 72 | ]; 73 | if ($permission['allow']) { 74 | $check = $this->model; 75 | $check = $check->where('permission_id', $permission['permission_id']); 76 | $check = $check->where('role_id', $role['id']); 77 | $check = $check->onlyTrashed()->first(); 78 | if ($check) { 79 | $save = $this->deleteRestoreBatch([$check->id], 'restore'); // jika pernah dibuat namun pernah di disallow 80 | $save = $check; 81 | } 82 | else $save = $this->store($permission['id'], $data); // belum ada sama sekali 83 | } 84 | else $save = $this->deleteRestoreBatch([$permission['id']], 'delete'); 85 | return json_decode($save); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /app/Repositories/UsersRepository.php: -------------------------------------------------------------------------------- 1 | request = $request; 23 | $this->model = $this->initModel(); 24 | } 25 | 26 | /** 27 | * Model initiate 28 | * @return object 29 | */ 30 | public function initModel($id = null) { 31 | $model = new Users; 32 | if (!empty($id)) $model = $this->model->where($this->model->getKeyName(), $id)->first(); 33 | return $model; 34 | } 35 | 36 | public function store ($id = null, $customPayload = null) { 37 | try { 38 | $payload = $this->request->all(); 39 | if ($customPayload) $payload = $customPayload; 40 | $data = $this->initModel($id); 41 | 42 | $data->name = H_hasProps($payload, 'name'); 43 | $data->email = H_hasProps($payload, 'email'); 44 | // $data->password = H_hasProps($payload, 'password'); 45 | 46 | $this->setLogHistory($data); 47 | 48 | $data->save(); 49 | return $data; 50 | } catch (Exception $e){ 51 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::store] ')); 52 | } 53 | } 54 | 55 | // Fetching, Delete & Restore functions there are in Traits/StandardRepo 56 | 57 | public function userProfile () { 58 | try { 59 | $payload = $this->request->all(); 60 | $id = H_hasProps($payload, 'id'); 61 | $username = H_hasProps($payload, 'username'); 62 | if (!$id && !$username) throw new Exception("Set params ?id=value OR ?username=value for get the profile"); 63 | 64 | $data = DB::table($this->tableName() . " as us")->select([ 65 | 'us.id', 66 | 'us.name', 67 | 'us.username', 68 | 'us.email', 69 | 'us.picture', 70 | 'us.is_ban', 71 | 'is_ban', 72 | 'rl.slug as role_slug', 73 | 'rl.name as role_name', 74 | ]) 75 | ->join('roles as rl', 'rl.id', '=', 'us.role_id'); 76 | if ($id) $data = $data->whereId($id); 77 | elseif ($username) $data = $data->whereUsername($username); 78 | 79 | return $data->first(); 80 | } catch (Exception $e){ 81 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::userProfile] ')); 82 | } 83 | } 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /app/Services/Notify.php: -------------------------------------------------------------------------------- 1 | H_hasProps($body, 'title'), 13 | 'content' => H_hasProps($body, 'content'), 14 | 'type' => H_hasProps($body, 'type', 'system'), 15 | 'category' => H_hasProps($body, 'category'), 16 | 'link_source' => H_hasProps($body, 'link_source', 'external'), 17 | 'link_url' => H_hasProps($body, 'link_url'), 18 | 'date' => H_hasProps($body, 'date', H_today()), 19 | 'created_by' => H_hasProps($body, 'created_by'), 20 | 'created_at' => H_today(), 21 | 'created_ip' => H_getIpClient(), 22 | ]; 23 | } 24 | 25 | /** 26 | * Basic make raw notification 27 | * 28 | * @param Object $body : { title, content, category, type, link_source, link_url, date } 29 | * @param Integer $fromUserId : when null, set by default original name 30 | * @param Array $toUsers : array value of user id 31 | * 32 | */ 33 | public static function make($body, $fromUserId, $toUsers = []) : bool { 34 | try { 35 | 36 | if (!count($toUsers)) return false; // abort when there's no receiver 37 | if (!$fromUserId) return false; // abort when there's no sender 38 | 39 | $template = Notify::template($body); 40 | $template['created_by'] = $fromUserId; 41 | 42 | $notification = Notifications::create($template); 43 | 44 | if ($notification) { 45 | $receiver = []; 46 | foreach ($toUsers as $userId) { 47 | $receiver[] = [ 48 | 'user_id' => $userId, 49 | 'notification_id' => $notification->id, 50 | 'created_by' => $fromUserId, 51 | 'created_at' => H_today(), 52 | 'created_ip' => H_getIpClient(), 53 | ]; 54 | } 55 | 56 | return UserNotifications::insert($receiver); 57 | } else return false; 58 | 59 | } catch (Exception $e){ 60 | throw new Exception(H_throw($e, '['.get_class().'::make]')); 61 | } 62 | 63 | } 64 | 65 | 66 | 67 | } -------------------------------------------------------------------------------- /app/Services/Uploader.php: -------------------------------------------------------------------------------- 1 | hasFile('file') 12 | * @param String $fileName : when null, set by default original name 13 | * @param String $path : path location of file 14 | * @param String $allowExtension : extension validation, when value is [] , validation aborted 15 | * 16 | */ 17 | public static function upload($file, $path = 'public/uploads', $fileName = null , $allowExtension = []) { 18 | try { 19 | if ($file) { 20 | $name = $file->getClientOriginalName(); 21 | $ext = $file->getClientOriginalExtension(); 22 | $mime = $file->getMimeType(); 23 | $size = $file->getSize(); 24 | 25 | if (!$fileName) $fileName = uniqid("FU_"); 26 | if ($fileName == 'original') $fileName = $name; 27 | 28 | $fileName = "{$fileName}.{$ext}"; 29 | 30 | if (count($allowExtension)) { 31 | $extensions = []; 32 | foreach ($allowExtension as $extension) { 33 | $extensions[] = strtolower($extension); 34 | } 35 | if (!in_array(strtolower($ext), $extensions)) throw new Exception("File with extension $ext is denied to upload!"); 36 | } 37 | 38 | Storage::putFileAs($path, $file, $fileName); // upload file 39 | 40 | return (object) [ 41 | "name" => $fileName, 42 | "mime" => $mime, 43 | "size" => $size, 44 | "size" => H_fileSize($size), 45 | "path" => $path, 46 | "fix_path" => Storage::url($path), 47 | "url" => env('APP_URL') . Storage::url("$path/{$fileName}"), 48 | ]; 49 | } else { 50 | throw new Exception("No file uploaded!"); 51 | } 52 | 53 | } catch (Exception $e){ 54 | throw new Exception(H_throw($e, '['.get_class().'::upload]')); 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "Lavux starter pack using Laravel & Vue.", 5 | "keywords": ["framework", "laravel", "vue", "quasar", "lavux"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.1", 9 | "guzzlehttp/guzzle": "^7.2", 10 | "laravel/framework": "^10.0", 11 | "laravel/sanctum": "^3.2", 12 | "laravel/tinker": "^2.8" 13 | }, 14 | "require-dev": { 15 | "fakerphp/faker": "^1.9.1", 16 | "laravel/pint": "^1.0", 17 | "laravel/sail": "^1.18", 18 | "mockery/mockery": "^1.4.4", 19 | "nunomaduro/collision": "^7.0", 20 | "phpunit/phpunit": "^10.0", 21 | "spatie/laravel-ignition": "^2.0" 22 | }, 23 | "autoload": { 24 | "psr-4": { 25 | "App\\": "app/", 26 | "Database\\Factories\\": "database/factories/", 27 | "Database\\Seeders\\": "database/seeders/" 28 | } 29 | }, 30 | "autoload-dev": { 31 | "psr-4": { 32 | "Tests\\": "tests/" 33 | }, 34 | "files": [ 35 | "app/helpers.php" 36 | ] 37 | }, 38 | "scripts": { 39 | "post-autoload-dump": [ 40 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 41 | "@php artisan package:discover --ansi" 42 | ], 43 | "post-update-cmd": [ 44 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 45 | ], 46 | "post-root-package-install": [ 47 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 48 | ], 49 | "post-create-project-cmd": [ 50 | "@php artisan key:generate --ansi" 51 | ] 52 | }, 53 | "extra": { 54 | "laravel": { 55 | "dont-discover": [] 56 | } 57 | }, 58 | "config": { 59 | "optimize-autoloader": true, 60 | "preferred-install": "dist", 61 | "sort-packages": true, 62 | "allow-plugins": { 63 | "pestphp/pest-plugin": true, 64 | "php-http/discovery": true 65 | } 66 | }, 67 | "minimum-stability": "stable", 68 | "prefer-stable": true 69 | } 70 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 40 | 'port' => env('PUSHER_PORT', 443), 41 | 'scheme' => env('PUSHER_SCHEME', 'https'), 42 | 'encrypted' => true, 43 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', 44 | ], 45 | 'client_options' => [ 46 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 47 | ], 48 | ], 49 | 50 | 'ably' => [ 51 | 'driver' => 'ably', 52 | 'key' => env('ABLY_KEY'), 53 | ], 54 | 55 | 'redis' => [ 56 | 'driver' => 'redis', 57 | 'connection' => 'default', 58 | ], 59 | 60 | 'log' => [ 61 | 'driver' => 'log', 62 | ], 63 | 64 | 'null' => [ 65 | 'driver' => 'null', 66 | ], 67 | 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | ], 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Symbolic Links 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Here you may configure the symbolic links that will be created when the 67 | | `storage:link` Artisan command is executed. The array keys should be 68 | | the locations of the links and the values should be their targets. 69 | | 70 | */ 71 | 72 | 'links' => [ 73 | public_path('storage') => storage_path('app/public'), 74 | ], 75 | 76 | ]; 77 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/lv_menu.php: -------------------------------------------------------------------------------- 1 | 'Home', 15 | 'route' => 'home', 16 | 'icon' => 'home', 17 | ], 18 | [ 19 | 'title' => 'Management', 20 | 'route' => null, 21 | 'icon' => 'manage_accounts', 22 | 'permissions' => [ 23 | 'permissions-browse', 24 | 'role-groups-browse', 25 | 'roles-browse', 26 | 'users-browse', 27 | ], 28 | 'children' => [ 29 | [ 30 | 'title' => 'Permissions', 31 | 'route' => 'permissions', 32 | 'icon' => 'assignment_turned_in', 33 | 'permissions' => ['permissions-browse'] 34 | ], 35 | [ 36 | 'title' => 'Role Groups', 37 | 'route' => 'role-groups', 38 | 'icon' => 'perm_contact_calendar', 39 | 'permissions' => ['role-groups-browse'] 40 | ], 41 | [ 42 | 'title' => 'Roles', 43 | 'route' => 'roles', 44 | 'icon' => 'admin_panel_settings', 45 | 'permissions' => ['roles-browse'] 46 | ], 47 | [ 48 | 'title' => 'Users', 49 | 'route' => 'users', 50 | 'icon' => 'group', 51 | 'permissions' => ['users-browse'], 52 | ], 53 | ] 54 | ], 55 | [ 56 | 'title' => 'Settings', 57 | 'route' => 'settings', 58 | 'icon' => 'tune', 59 | 'permissions' => ['global-settings'] 60 | ], 61 | ]; -------------------------------------------------------------------------------- /config/lv_modules.php: -------------------------------------------------------------------------------- 1 | "company", 18 | "comment" => "Configuration default of your company information, you can customize your config by editing file '/config/lv_setting.php' ", 19 | "list" => [ 20 | "name" => "PT Solusi Pembantu Usaha", 21 | "app_name" => "Lavux Enterprise Systems", 22 | "tag_line" => "Component library for Enterprise system", 23 | "phone" => "012 345 6789", 24 | "web" => "http://lavux.sopeus.com", 25 | "email" => "lavux@sopeus.com", 26 | "url_logo" => '/assets/logo.png', // url logo (default as sidebard logo) 27 | "url_icon" => '/assets/icon.png', // url icon 28 | "url_logo_light" => '/assets/logo-light.png', // url logo for "Top Menu Mode" 29 | ], 30 | ], 31 | // your configuration 32 | 33 | ]; -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Failed Queue Jobs 79 | |-------------------------------------------------------------------------- 80 | | 81 | | These options configure the behavior of failed queue job logging so you 82 | | can control which database and table are used to store the jobs that 83 | | have failed. You may change them to any database / table you wish. 84 | | 85 | */ 86 | 87 | 'failed' => [ 88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 89 | 'database' => env('DB_CONNECTION', 'mysql'), 90 | 'table' => 'failed_jobs', 91 | ], 92 | 93 | ]; 94 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UsersFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class UsersFactory extends Factory 12 | { 13 | /** 14 | * Define the model's default state. 15 | * 16 | * @return array 17 | */ 18 | public function definition(): array 19 | { 20 | $hobies = []; 21 | $hobies[] = fake()->jobTitle(); 22 | $hobies[] = fake()->jobTitle(); 23 | $hobies[] = fake()->jobTitle(); 24 | return [ 25 | 'name' => fake()->name(), 26 | 'email' => fake()->unique()->safeEmail(), 27 | 'email_verified_at' => null, 28 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 29 | 'remember_token' => Str::random(10), 30 | 'score' => 1, 31 | 'hobbies' => $hobies, 32 | 'is_dead' => false, 33 | 'born_date' => fake()->unique()->date(), 34 | ]; 35 | } 36 | 37 | /** 38 | * Indicate that the model's email address should be unverified. 39 | */ 40 | public function unverified(): static 41 | { 42 | return $this->state(fn (array $attributes) => [ 43 | 'email_verified_at' => null, 44 | ]); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /database/migrations/2012_08_14_000001_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2012_08_14_000001_create_password_reset_tokens_table.php: -------------------------------------------------------------------------------- 1 | string('email')->primary(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('password_reset_tokens'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2012_08_14_000001_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_08_14_112406_permissions_init.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id')->index(); 20 | if (!Schema::hasColumn($tableName, 'module')) $table->string('module'); 21 | if (!Schema::hasColumn($tableName, 'name')) $table->string('name'); 22 | 23 | if (!Schema::hasColumn($tableName, 'created_by')) $table->unsignedBigInteger('created_by')->nullable(); 24 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->unsignedBigInteger('updated_by')->nullable(); 25 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->unsignedBigInteger('deleted_by')->nullable(); 26 | 27 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->string('created_ip')->nullable(); 28 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->string('updated_ip')->nullable(); 29 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->string('deleted_ip')->nullable(); 30 | 31 | 32 | $table->timestamps(0); 33 | $table->softDeletes('deleted_at'); 34 | }); 35 | } 36 | 37 | /** 38 | * Reverse the migrations. 39 | * 40 | * @return void 41 | */ 42 | public function down() 43 | { 44 | $tableName = 'permissions'; 45 | Schema::table($tableName, function (Blueprint $table) use ($tableName) { 46 | if (!Schema::hasColumn($tableName, 'id')) $table->dropColumn('id'); 47 | if (!Schema::hasColumn($tableName, 'module')) $table->dropColumn('module'); 48 | if (!Schema::hasColumn($tableName, 'name')) $table->dropColumn('name'); 49 | 50 | if (!Schema::hasColumn($tableName, 'created_at')) $table->dropColumn('created_at'); 51 | if (!Schema::hasColumn($tableName, 'updated_at')) $table->dropColumn('updated_at'); 52 | if (!Schema::hasColumn($tableName, 'deleted_at')) $table->dropColumn('deleted_at'); 53 | 54 | if (!Schema::hasColumn($tableName, 'created_by')) $table->dropColumn('created_by'); 55 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->dropColumn('updated_by'); 56 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->dropColumn('deleted_by'); 57 | 58 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->dropColumn('created_ip'); 59 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->dropColumn('updated_ip'); 60 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->dropColumn('deleted_ip'); 61 | 62 | }); 63 | } 64 | }; 65 | -------------------------------------------------------------------------------- /database/migrations/2022_08_14_112406_role_groups_init.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id')->index(); 20 | if (!Schema::hasColumn($tableName, 'name')) $table->string('name'); 21 | 22 | if (!Schema::hasColumn($tableName, 'created_by')) $table->unsignedBigInteger('created_by')->nullable(); 23 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->unsignedBigInteger('updated_by')->nullable(); 24 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->unsignedBigInteger('deleted_by')->nullable(); 25 | 26 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->string('created_ip')->nullable(); 27 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->string('updated_ip')->nullable(); 28 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->string('deleted_ip')->nullable(); 29 | 30 | 31 | $table->timestamps(0); 32 | $table->softDeletes('deleted_at'); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | $tableName = 'role_groups'; 44 | Schema::table($tableName, function (Blueprint $table) use ($tableName) { 45 | if (!Schema::hasColumn($tableName, 'id')) $table->dropColumn('id'); 46 | if (!Schema::hasColumn($tableName, 'name')) $table->dropColumn('name'); 47 | 48 | if (!Schema::hasColumn($tableName, 'created_at')) $table->dropColumn('created_at'); 49 | if (!Schema::hasColumn($tableName, 'updated_at')) $table->dropColumn('updated_at'); 50 | if (!Schema::hasColumn($tableName, 'deleted_at')) $table->dropColumn('deleted_at'); 51 | 52 | if (!Schema::hasColumn($tableName, 'created_by')) $table->dropColumn('created_by'); 53 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->dropColumn('updated_by'); 54 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->dropColumn('deleted_by'); 55 | 56 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->dropColumn('created_ip'); 57 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->dropColumn('updated_ip'); 58 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->dropColumn('deleted_ip'); 59 | 60 | }); 61 | } 62 | }; 63 | -------------------------------------------------------------------------------- /database/migrations/2022_08_14_112406_role_permissions_init.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id')->index(); 20 | if (!Schema::hasColumn($tableName, 'permission_id')) $table->unsignedBigInteger('permission_id')->index(); 21 | if (!Schema::hasColumn($tableName, 'role_id')) $table->unsignedBigInteger('role_id')->index(); 22 | 23 | if (!Schema::hasColumn($tableName, 'created_by')) $table->unsignedBigInteger('created_by')->nullable(); 24 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->unsignedBigInteger('updated_by')->nullable(); 25 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->unsignedBigInteger('deleted_by')->nullable(); 26 | 27 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->string('created_ip')->nullable(); 28 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->string('updated_ip')->nullable(); 29 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->string('deleted_ip')->nullable(); 30 | 31 | 32 | $table->timestamps(0); 33 | $table->softDeletes('deleted_at'); 34 | }); 35 | } 36 | 37 | /** 38 | * Reverse the migrations. 39 | * 40 | * @return void 41 | */ 42 | public function down() 43 | { 44 | $tableName = 'role_permissions'; 45 | Schema::table($tableName, function (Blueprint $table) use ($tableName) { 46 | if (!Schema::hasColumn($tableName, 'id')) $table->dropColumn('id'); 47 | if (!Schema::hasColumn($tableName, 'permission_id')) $table->dropColumn('permission_id'); 48 | if (!Schema::hasColumn($tableName, 'role_id')) $table->dropColumn('role_id'); 49 | 50 | if (!Schema::hasColumn($tableName, 'created_at')) $table->dropColumn('created_at'); 51 | if (!Schema::hasColumn($tableName, 'updated_at')) $table->dropColumn('updated_at'); 52 | if (!Schema::hasColumn($tableName, 'deleted_at')) $table->dropColumn('deleted_at'); 53 | 54 | if (!Schema::hasColumn($tableName, 'created_by')) $table->dropColumn('created_by'); 55 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->dropColumn('updated_by'); 56 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->dropColumn('deleted_by'); 57 | 58 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->dropColumn('created_ip'); 59 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->dropColumn('updated_ip'); 60 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->dropColumn('deleted_ip'); 61 | 62 | }); 63 | } 64 | }; 65 | -------------------------------------------------------------------------------- /database/migrations/2022_08_14_112406_roles_init.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id')->index(); 20 | if (!Schema::hasColumn($tableName, 'role_group_id')) $table->unsignedBigInteger('role_group_id')->index()->nullable(); 21 | if (!Schema::hasColumn($tableName, 'name')) $table->string('name'); 22 | if (!Schema::hasColumn($tableName, 'slug')) $table->string('slug')->nullable(); 23 | 24 | if (!Schema::hasColumn($tableName, 'created_by')) $table->unsignedBigInteger('created_by')->nullable(); 25 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->unsignedBigInteger('updated_by')->nullable(); 26 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->unsignedBigInteger('deleted_by')->nullable(); 27 | 28 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->string('created_ip')->nullable(); 29 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->string('updated_ip')->nullable(); 30 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->string('deleted_ip')->nullable(); 31 | 32 | 33 | $table->timestamps(0); 34 | $table->softDeletes('deleted_at'); 35 | }); 36 | } 37 | 38 | /** 39 | * Reverse the migrations. 40 | * 41 | * @return void 42 | */ 43 | public function down() 44 | { 45 | $tableName = 'roles'; 46 | Schema::table($tableName, function (Blueprint $table) use ($tableName) { 47 | if (!Schema::hasColumn($tableName, 'id')) $table->dropColumn('id'); 48 | if (!Schema::hasColumn($tableName, 'role_group_id')) $table->dropColumn('role_group_id'); 49 | if (!Schema::hasColumn($tableName, 'name')) $table->dropColumn('name'); 50 | if (!Schema::hasColumn($tableName, 'slug')) $table->dropColumn('slug'); 51 | 52 | if (!Schema::hasColumn($tableName, 'created_at')) $table->dropColumn('created_at'); 53 | if (!Schema::hasColumn($tableName, 'updated_at')) $table->dropColumn('updated_at'); 54 | if (!Schema::hasColumn($tableName, 'deleted_at')) $table->dropColumn('deleted_at'); 55 | 56 | if (!Schema::hasColumn($tableName, 'created_by')) $table->dropColumn('created_by'); 57 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->dropColumn('updated_by'); 58 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->dropColumn('deleted_by'); 59 | 60 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->dropColumn('created_ip'); 61 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->dropColumn('updated_ip'); 62 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->dropColumn('deleted_ip'); 63 | 64 | }); 65 | } 66 | }; 67 | -------------------------------------------------------------------------------- /generator/template/api/Migration.lvt: -------------------------------------------------------------------------------- 1 | >'; 18 | Schema::create($tableName, function (Blueprint $table) use ($tableName) { 19 | <> 20 | if (!Schema::hasColumn($tableName, 'created_by')) $table->unsignedBigInteger('created_by')->nullable(); 21 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->unsignedBigInteger('updated_by')->nullable(); 22 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->unsignedBigInteger('deleted_by')->nullable(); 23 | 24 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->string('created_ip')->nullable(); 25 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->string('updated_ip')->nullable(); 26 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->string('deleted_ip')->nullable(); 27 | 28 | <> 29 | $table->timestamps(0); 30 | $table->softDeletes('deleted_at'); 31 | }); 32 | } 33 | 34 | /** 35 | * Reverse the migrations. 36 | * 37 | * @return void 38 | */ 39 | public function down() 40 | { 41 | $tableName = '<>'; 42 | Schema::table($tableName, function (Blueprint $table) use ($tableName) { 43 | <> 44 | if (!Schema::hasColumn($tableName, 'created_at')) $table->dropColumn('created_at'); 45 | if (!Schema::hasColumn($tableName, 'updated_at')) $table->dropColumn('updated_at'); 46 | if (!Schema::hasColumn($tableName, 'deleted_at')) $table->dropColumn('deleted_at'); 47 | 48 | if (!Schema::hasColumn($tableName, 'created_by')) $table->dropColumn('created_by'); 49 | if (!Schema::hasColumn($tableName, 'updated_by')) $table->dropColumn('updated_by'); 50 | if (!Schema::hasColumn($tableName, 'deleted_by')) $table->dropColumn('deleted_by'); 51 | 52 | if (!Schema::hasColumn($tableName, 'created_ip')) $table->dropColumn('created_ip'); 53 | if (!Schema::hasColumn($tableName, 'updated_ip')) $table->dropColumn('updated_ip'); 54 | if (!Schema::hasColumn($tableName, 'deleted_ip')) $table->dropColumn('deleted_ip'); 55 | 56 | }); 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /generator/template/api/Model.lvt: -------------------------------------------------------------------------------- 1 | > 15 | */ 16 | class <> extends Model 17 | { 18 | use HasApiTokens, HasFactory, Notifiable; 19 | use SoftDeletes, StandardModel, <>_H; 20 | 21 | protected $table = '<
>'; 22 | protected $primaryKey = 'id'; 23 | 24 | protected $fillable = [ 25 | <> 26 | ]; 27 | 28 | public $timestamps = true; 29 | protected $guarded = ['id']; 30 | 31 | protected $casts = [ 32 | <> 33 | ]; 34 | 35 | // automatic appends attributes 36 | protected $appends = [ 37 | 'log_data' // default log data, from StandardModel 38 | // 'your_attr' 39 | ]; 40 | 41 | /** Search Relations 42 | * for availability searching by relation data, needed in StandardRepo 43 | */ 44 | public function searchRelations() { 45 | try { 46 | return $this->bindSearchRelation([ 47 | <> 48 | ]); 49 | } catch (\Exception $e){ 50 | throw new \Exception(H_throw($e, H_getModelName(get_class()).'::searchRelations]')); 51 | } 52 | } 53 | 54 | /* Relations : belongsTo */ 55 | 56 | <> 57 | 58 | /* Relations : hasMany */ 59 | 60 | <> 61 | 62 | /* Relations : morphTo */ 63 | 64 | <> 65 | 66 | } 67 | -------------------------------------------------------------------------------- /generator/template/api/Model_H.lvt: -------------------------------------------------------------------------------- 1 | >_H 7 | { 8 | 9 | <> 10 | 11 | /* See details format on StandardModel->filterListBase() */ 12 | public function filterList () { 13 | $overide = [ 14 | <> 15 | ]; 16 | $res = $this->mergeFilterList( 17 | $this->filterListBase(), // from "app/Traits/StandardModel" 18 | $overide // you can overide previous value into real value you need 19 | ); 20 | return $res; 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /generator/template/api/Repository.lvt: -------------------------------------------------------------------------------- 1 | >; 8 | use Exception; 9 | 10 | use App\Traits\StandardRepo; 11 | 12 | class <>Repository 13 | { 14 | use StandardRepo; 15 | 16 | public $request; 17 | public $model; 18 | 19 | public function __construct( 20 | Request $request 21 | ) { 22 | $this->request = $request; 23 | $this->model = $this->initModel(); 24 | } 25 | 26 | /** 27 | * Model initiate 28 | * @return object 29 | */ 30 | public function initModel($id = null) { 31 | $model = new <>; 32 | if (!empty($id)) $model = $this->model->where($this->model->getKeyName(), $id)->first(); 33 | return $model; 34 | } 35 | 36 | public function store ($id = null, $customPayload = null) { 37 | try { 38 | $payload = $this->request->all(); 39 | if ($customPayload) $payload = $customPayload; 40 | $data = $this->initModel($id); 41 | 42 | <
> 43 | $this->setLogHistory($data); 44 | 45 | $data->save(); 46 | return $data; 47 | } catch (Exception $e){ 48 | throw new Exception(H_throw($e, '['.H_getRepositoryName(get_class()).'::store] ')); 49 | } 50 | } 51 | 52 | // Fetching, Delete & Restore functions there are in Traits/StandardRepo 53 | 54 | } 55 | -------------------------------------------------------------------------------- /generator/template/requirement.lvt: -------------------------------------------------------------------------------- 1 | # Standard Requirement Modules 2 | 3 | ## API 4 | > place it or add in : config/lv_modules.php 5 | assign the value into "return" 6 | 7 | ``` 8 | modules = [ 9 | <> 10 | ] 11 | ``` 12 | 13 | ``` 14 | menus = [ 15 | <> 16 | ] 17 | ``` 18 | 19 | ## UI 20 | > place it or add in : ui/src/router/route.js 21 | assign into "moduleList" 22 | 23 | ``` 24 | routeUi = [ 25 | <> 26 | ] 27 | ``` 28 | -------------------------------------------------------------------------------- /generator/template/ui/Meta.lvt: -------------------------------------------------------------------------------- 1 | import { Handler } from './../../services/Handler' 2 | 3 | const Meta = { 4 | name: '<>', 5 | module: '<>', 6 | moduleName: null, 7 | keyLabel: '<>', // properties for getter value of display subtitle in detail 8 | searchBy: [<>], // define the specific column for global search 9 | // withRelation will overide relation mapping in API, if you want to default follow API setting, just set [] 10 | withRelation: [<>], // including specific relation data when fetching 11 | topBarMenu: [], 12 | permission: null, 13 | model: { 14 | <> 15 | }, 16 | columns: [ 17 | { name: 'action', label: '#', align: 'left', width: '20px', searchable: false }, 18 | <> { name: 'log_data', label: 'Log', field: 'log_data', searchable: false }, 19 | ] 20 | } 21 | 22 | Meta.moduleName = Handler.makeModuleName(Meta.module) 23 | 24 | Meta.permission = { 25 | browse: Handler.permissionPage(`${Meta.module} browse`), 26 | create: Handler.permissionPage(`${Meta.module} create`), 27 | read: Handler.permissionPage(`${Meta.module} read`), 28 | update: Handler.permissionPage(`${Meta.module} update`), 29 | delete: Handler.permissionPage(`${Meta.module} delete`), 30 | restore: Handler.permissionPage(`${Meta.module} restore`), 31 | } 32 | 33 | // uncomment this if you want to allow all permission / disable permission handler feature 34 | // Meta.permission = Handler.makeAllPermissionAllowed(Meta.permission) 35 | 36 | // uncomment this if you want to set all columns using simple search 37 | // Meta.columns = Handler.makeSimpleSearchable(Meta.columns) 38 | 39 | export default Meta 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build" 6 | }, 7 | "devDependencies": { 8 | "axios": "^1.1.2", 9 | "laravel-vite-plugin": "^0.7.2", 10 | "vite": "^4.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/public/favicon.ico -------------------------------------------------------------------------------- /public/global/images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/public/global/images/404.png -------------------------------------------------------------------------------- /public/global/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/public/global/images/icon.png -------------------------------------------------------------------------------- /public/global/images/logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/public/global/images/logo-light.png -------------------------------------------------------------------------------- /public/global/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/public/global/images/logo.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/resources/css/app.css -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * We'll load the axios HTTP library which allows us to easily issue requests 3 | * to our Laravel back-end. This library automatically handles sending the 4 | * CSRF token as a header based on the value of the "XSRF" token cookie. 5 | */ 6 | 7 | import axios from 'axios'; 8 | window.axios = axios; 9 | 10 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 11 | 12 | /** 13 | * Echo exposes an expressive API for subscribing to channels and listening 14 | * for events that are broadcast by Laravel. Echo and event broadcasting 15 | * allows your team to easily build robust real-time web applications. 16 | */ 17 | 18 | // import Echo from 'laravel-echo'; 19 | 20 | // import Pusher from 'pusher-js'; 21 | // window.Pusher = Pusher; 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 26 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1', 27 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 28 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 29 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 30 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 31 | // enabledTransports: ['ws', 'wss'], 32 | // }); 33 | -------------------------------------------------------------------------------- /resources/views/errors/401.blade.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 401 - Unauthorize 10 | 11 | 12 | 13 |
14 | 401 15 |
16 | Your dont have authorization to access this page 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /resources/views/errors/403.blade.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 401 - Forbidden 10 | 11 | 12 | 13 |
14 | 401 15 |
16 | Your dont have permission to access this page 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 404 - Not Found 10 | 11 | 12 | 13 |
14 | 404 15 |
16 | Your page looking is not found 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /resources/views/frontend.blade.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/ui_route.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "401", 4 | "path": "/401" 5 | }, 6 | { 7 | "name": "403", 8 | "path": "/403" 9 | }, 10 | { 11 | "name": "404", 12 | "path": "/404" 13 | }, 14 | { 15 | "name": "change-password", 16 | "path": "/me/change-password" 17 | }, 18 | { 19 | "name": "example", 20 | "path": "/example" 21 | }, 22 | { 23 | "name": "generator", 24 | "path": "/generator" 25 | }, 26 | { 27 | "name": "home", 28 | "path": "/" 29 | }, 30 | { 31 | "name": "login", 32 | "path": "/login" 33 | }, 34 | { 35 | "name": "metas", 36 | "path": "/metas" 37 | }, 38 | { 39 | "name": "metas-add", 40 | "path": "/metas/form" 41 | }, 42 | { 43 | "name": "metas-detail", 44 | "path": "/metas/:id" 45 | }, 46 | { 47 | "name": "metas-edit", 48 | "path": "/metas/form/:id" 49 | }, 50 | { 51 | "name": "notifications", 52 | "path": "/me/notifications" 53 | }, 54 | { 55 | "name": "permissions", 56 | "path": "/permissions" 57 | }, 58 | { 59 | "name": "permissions-add", 60 | "path": "/permissions/form" 61 | }, 62 | { 63 | "name": "permissions-detail", 64 | "path": "/permissions/:id" 65 | }, 66 | { 67 | "name": "permissions-edit", 68 | "path": "/permissions/form/:id" 69 | }, 70 | { 71 | "name": "role-groups", 72 | "path": "/role-groups" 73 | }, 74 | { 75 | "name": "role-groups-add", 76 | "path": "/role-groups/form" 77 | }, 78 | { 79 | "name": "role-groups-detail", 80 | "path": "/role-groups/:id" 81 | }, 82 | { 83 | "name": "role-groups-edit", 84 | "path": "/role-groups/form/:id" 85 | }, 86 | { 87 | "name": "role-permissions", 88 | "path": "/role-permissions" 89 | }, 90 | { 91 | "name": "role-permissions-add", 92 | "path": "/role-permissions/form" 93 | }, 94 | { 95 | "name": "role-permissions-detail", 96 | "path": "/role-permissions/:id" 97 | }, 98 | { 99 | "name": "role-permissions-edit", 100 | "path": "/role-permissions/form/:id" 101 | }, 102 | { 103 | "name": "roles", 104 | "path": "/roles" 105 | }, 106 | { 107 | "name": "roles-add", 108 | "path": "/roles/form" 109 | }, 110 | { 111 | "name": "roles-detail", 112 | "path": "/roles/:id" 113 | }, 114 | { 115 | "name": "roles-edit", 116 | "path": "/roles/form/:id" 117 | }, 118 | { 119 | "name": "settings", 120 | "path": "/settings" 121 | }, 122 | { 123 | "name": "update-profile", 124 | "path": "/me/update-profile" 125 | }, 126 | { 127 | "name": "users", 128 | "path": "/users" 129 | }, 130 | { 131 | "name": "users-add", 132 | "path": "/users/form" 133 | }, 134 | { 135 | "name": "users-detail", 136 | "path": "/users/:id" 137 | }, 138 | { 139 | "name": "users-edit", 140 | "path": "/users/form/:id" 141 | } 142 | ] -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 18 | 19 | return $app; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ui/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /ui/.eslintignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /src-bex/www 3 | /src-capacitor 4 | /src-cordova 5 | /.quasar 6 | /node_modules 7 | .eslintrc.js 8 | babel.config.js 9 | -------------------------------------------------------------------------------- /ui/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy 3 | // This option interrupts the configuration hierarchy at this file 4 | // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos) 5 | root: true, 6 | 7 | parserOptions: { 8 | parser: "@babel/eslint-parser", 9 | ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features 10 | sourceType: "module", // Allows for the use of imports 11 | }, 12 | 13 | env: { 14 | browser: true, 15 | }, 16 | 17 | // Rules order is important, please avoid shuffling them 18 | extends: [ 19 | // Base ESLint recommended rules 20 | // 'eslint:recommended', 21 | 22 | // Uncomment any of the lines below to choose desired strictness, 23 | // but leave only one uncommented! 24 | // See https://eslint.vuejs.org/rules/#available-rules 25 | "plugin:vue/vue3-essential", // Priority A: Essential (Error Prevention) 26 | // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) 27 | // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) 28 | 29 | // https://github.com/prettier/eslint-config-prettier#installation 30 | // usage with Prettier, provided by 'eslint-config-prettier'. 31 | "prettier", 32 | ], 33 | 34 | plugins: [ 35 | // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files 36 | // required to lint *.vue files 37 | "vue", 38 | 39 | // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674 40 | // Prettier has not been included as plugin to avoid performance impact 41 | // add it as an extension for your IDE 42 | ], 43 | 44 | globals: { 45 | ga: "readonly", // Google Analytics 46 | cordova: "readonly", 47 | __statics: "readonly", 48 | __QUASAR_SSR__: "readonly", 49 | __QUASAR_SSR_SERVER__: "readonly", 50 | __QUASAR_SSR_CLIENT__: "readonly", 51 | __QUASAR_SSR_PWA__: "readonly", 52 | process: "readonly", 53 | Capacitor: "readonly", 54 | chrome: "readonly", 55 | }, 56 | 57 | // add your custom rules here 58 | rules: { 59 | "prefer-promise-reject-errors": "off", 60 | 61 | // allow debugger during development only 62 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", 63 | }, 64 | }; 65 | -------------------------------------------------------------------------------- /ui/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .thumbs.db 3 | node_modules 4 | 5 | # Quasar core related directories 6 | .quasar 7 | /dist 8 | 9 | # Cordova related directories and files 10 | /src-cordova/node_modules 11 | /src-cordova/platforms 12 | /src-cordova/plugins 13 | /src-cordova/www 14 | 15 | # Capacitor related directories and files 16 | /src-capacitor/www 17 | /src-capacitor/node_modules 18 | 19 | # BEX related directories and files 20 | /src-bex/www 21 | /src-bex/js/core 22 | 23 | # Log files 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # Editor directories and files 29 | .idea 30 | *.suo 31 | *.ntvs* 32 | *.njsproj 33 | *.sln 34 | -------------------------------------------------------------------------------- /ui/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | plugins: [ 5 | // to edit target browsers: use "browserslist" field in package.json 6 | require("autoprefixer"), 7 | ], 8 | }; 9 | -------------------------------------------------------------------------------- /ui/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode", 5 | "editorconfig.editorconfig", 6 | "johnsoncodehk.volar", 7 | "wayou.vscode-todo-highlight" 8 | ], 9 | "unwantedRecommendations": [ 10 | "octref.vetur", 11 | "hookyqr.beautify", 12 | "dbaeumer.jshint", 13 | "ms-vscode.vscode-typescript-tslint-plugin" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /ui/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.bracketPairColorization.enabled": true, 3 | "editor.guides.bracketPairs": true, 4 | "editor.formatOnSave": true, 5 | "editor.defaultFormatter": "esbenp.prettier-vscode", 6 | "editor.codeActionsOnSave": ["source.fixAll.eslint"], 7 | "eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"] 8 | } 9 | -------------------------------------------------------------------------------- /ui/README.md: -------------------------------------------------------------------------------- 1 | # LavuxUI (lavux-ui) 2 | 3 | Frontend App for Lavux 4 | 5 | ## Install the dependencies 6 | 7 | ```bash 8 | npm install 9 | ``` 10 | 11 | ### Start the app in development mode (hot-code reloading, error reporting, etc.) 12 | 13 | ```bash 14 | quasar dev 15 | ``` 16 | 17 | ### Lint the files 18 | 19 | ```bash 20 | npm run lint 21 | ``` 22 | 23 | ### Format the files 24 | 25 | ```bash 26 | npm run format 27 | ``` 28 | 29 | ### Build the app for production 30 | 31 | ```bash 32 | quasar build 33 | ``` 34 | 35 | ### Customize the configuration 36 | 37 | See [Configuring quasar.conf.js](https://quasar.dev/quasar-cli/quasar-conf-js). 38 | -------------------------------------------------------------------------------- /ui/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = (api) => { 2 | return { 3 | presets: [ 4 | [ 5 | "@quasar/babel-preset-app", 6 | api.caller((caller) => caller && caller.target === "node") 7 | ? { targets: { node: "current" } } 8 | : {}, 9 | ], 10 | ], 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /ui/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "src/*": ["src/*"], 6 | "app/*": ["*"], 7 | "components/*": ["src/components/*"], 8 | "layouts/*": ["src/layouts/*"], 9 | "pages/*": ["src/pages/*"], 10 | "assets/*": ["src/assets/*"], 11 | "boot/*": ["src/boot/*"], 12 | "vue$": ["node_modules/vue/dist/vue.runtime.esm-bundler.js"] 13 | } 14 | }, 15 | "exclude": ["dist", ".quasar", "node_modules"] 16 | } 17 | -------------------------------------------------------------------------------- /ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lavux-ui", 3 | "version": "0.0.1", 4 | "description": "Frontend App for Lavux", 5 | "productName": "LavuxUI", 6 | "author": "ikhbalfuady ", 7 | "private": true, 8 | "scripts": { 9 | "lint": "eslint --ext .js,.vue ./", 10 | "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", 11 | "test": "echo \"No test specified\" && exit 0" 12 | }, 13 | "dependencies": { 14 | "@quasar/extras": "^1.0.0", 15 | "axios": "^0.21.1", 16 | "core-js": "^3.6.5", 17 | "pinia": "^2.0.32", 18 | "quasar": "^2.0.0", 19 | "v-money3": "^3.21.0", 20 | "vue": "^3.0.0", 21 | "vue-router": "^4.0.0" 22 | }, 23 | "devDependencies": { 24 | "@babel/eslint-parser": "^7.13.14", 25 | "@quasar/app": "^3.0.0", 26 | "eslint": "^7.14.0", 27 | "eslint-config-prettier": "^8.1.0", 28 | "eslint-plugin-vue": "^7.0.0", 29 | "eslint-webpack-plugin": "^2.4.0", 30 | "prettier": "^2.5.1" 31 | }, 32 | "browserslist": [ 33 | "last 10 Chrome versions", 34 | "last 10 Firefox versions", 35 | "last 4 Edge versions", 36 | "last 7 Safari versions", 37 | "last 8 Android versions", 38 | "last 8 ChromeAndroid versions", 39 | "last 8 FirefoxAndroid versions", 40 | "last 10 iOS versions", 41 | "last 5 Opera versions" 42 | ], 43 | "engines": { 44 | "node": ">= 12.22.1", 45 | "npm": ">= 6.13.4", 46 | "yarn": ">= 1.21.1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ui/public/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/assets/icon.png -------------------------------------------------------------------------------- /ui/public/assets/images/grettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/assets/images/grettings.png -------------------------------------------------------------------------------- /ui/public/assets/logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/assets/logo-light.png -------------------------------------------------------------------------------- /ui/public/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/assets/logo.png -------------------------------------------------------------------------------- /ui/public/assets/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lavux by Sopeus", 3 | "short_name": "lavux", 4 | "icons": [ 5 | { 6 | "src": "icons/favicon-16x16.png", 7 | "sizes": "16x16", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "icons/favicon-32x32.png", 12 | "sizes": "32x32", 13 | "type": "image/png" 14 | }, 15 | { 16 | "src": "icons/favicon-96x96.png", 17 | "sizes": "96x96", 18 | "type": "image/png" 19 | }, 20 | { 21 | "src": "icons/favicon-128x128.png", 22 | "sizes": "128x128", 23 | "type": "image/png" 24 | } 25 | ], 26 | "start_url": "/", 27 | "display": "standalone", 28 | "background_color": "#1e293b", 29 | "theme_color": "#1855c7" 30 | } 31 | -------------------------------------------------------------------------------- /ui/public/assets/noimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/assets/noimg.png -------------------------------------------------------------------------------- /ui/public/assets/pattern-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/assets/pattern-1.jpg -------------------------------------------------------------------------------- /ui/public/icons/favicon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/icons/favicon-128x128.png -------------------------------------------------------------------------------- /ui/public/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/icons/favicon-16x16.png -------------------------------------------------------------------------------- /ui/public/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/icons/favicon-32x32.png -------------------------------------------------------------------------------- /ui/public/icons/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/icons/favicon-96x96.png -------------------------------------------------------------------------------- /ui/public/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/public/icons/favicon.ico -------------------------------------------------------------------------------- /ui/src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 11 | -------------------------------------------------------------------------------- /ui/src/boot/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ikhbalfuady/lavux/cd482a20f02cc2214d55de0b4e0b11bca56a8496/ui/src/boot/.gitkeep -------------------------------------------------------------------------------- /ui/src/boot/axios.js: -------------------------------------------------------------------------------- 1 | import { boot } from "quasar/wrappers"; 2 | import axios from "axios"; 3 | 4 | // Be careful when using SSR for cross-request state pollution 5 | // due to creating a Singleton instance here; 6 | // If any client changes this (global) instance, it might be a 7 | // good idea to move this instance creation inside of the 8 | // "export default () => {}" function below (which runs individually 9 | // for each client) 10 | const api = axios.create({ baseURL: "https://api.example.com" }); 11 | 12 | export default boot(({ app }) => { 13 | // for use inside Vue files (Options API) through this.$axios and this.$api 14 | 15 | app.config.globalProperties.$axios = axios; 16 | // ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form) 17 | // so you won't necessarily have to import axios in each vue file 18 | 19 | app.config.globalProperties.$api = api; 20 | // ^ ^ ^ this will allow you to use this.$api (for Vue Options API form) 21 | // so you can easily perform requests against your app's API 22 | }); 23 | 24 | export { api }; 25 | -------------------------------------------------------------------------------- /ui/src/components/core/Echo.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | 23 | 50 | -------------------------------------------------------------------------------- /ui/src/components/core/Notif.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /ui/src/components/core/SideNavListItem.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 46 | -------------------------------------------------------------------------------- /ui/src/components/core/TopBar.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | -------------------------------------------------------------------------------- /ui/src/components/core/TopMenus.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /ui/src/components/core/TopNavList.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | -------------------------------------------------------------------------------- /ui/src/components/globals/ForbiddenPage.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 25 | -------------------------------------------------------------------------------- /ui/src/components/globals/UnauthorizePage.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 26 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvActionBox.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvActionItem.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvBanner.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvBreadcumb.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 39 | 56 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvContainer.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 74 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvHeaderPage.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 93 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvLink.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvLoading.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 37 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvLogData.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 54 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvOpenLink.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvText.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 21 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvUser.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 85 | -------------------------------------------------------------------------------- /ui/src/components/lavux/LvViewItem.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | -------------------------------------------------------------------------------- /ui/src/composables/Services.js: -------------------------------------------------------------------------------- 1 | import { Handler } from './../services/Handler' 2 | import { Helper } from './../services/Helper' 3 | import Api from './../services/Api' 4 | import { Config } from './../Config' 5 | import { useMeta } from 'quasar'; 6 | import { createPinia } from 'pinia' 7 | import { useGlobalStore } from './../store/GlobalStore'; 8 | 9 | const useServices = () => { 10 | 11 | const SetMetaPage = (title, meta = {}) => { 12 | title = Helper.capitalFirst(title) 13 | useMeta({ 14 | title, 15 | titleTemplate: (title) => `${title ? `${title} | ` : ''}${Config.appName()}`, 16 | ...meta 17 | }) 18 | } 19 | 20 | return { 21 | Config: Config, 22 | Handler: Handler, 23 | Helper: Helper, 24 | Api: new Api(), 25 | Store: createPinia(), 26 | GlobalStore: useGlobalStore(), 27 | SetMetaPage 28 | } 29 | 30 | } 31 | 32 | export default useServices -------------------------------------------------------------------------------- /ui/src/css/quasar.variables.scss: -------------------------------------------------------------------------------- 1 | // Quasar SCSS (& Sass) Variables 2 | // -------------------------------------------------- 3 | // To customize the look and feel of this app, you can override 4 | // the Sass/SCSS variables found in Quasar's source Sass/SCSS files. 5 | 6 | // Check documentation for full list of Quasar variables 7 | 8 | // Your own variables (that are declared here) and Quasar's own 9 | // ones will be available out of the box in your .vue/.scss/.sass files 10 | 11 | // It's highly recommended to change the default colors 12 | // to match your app's branding. 13 | // Tip: Use the "Theme Builder" on Quasar's documentation website. 14 | 15 | $primary: #1855c7; 16 | $secondary: #26a69a; 17 | // $accent: #9c27b0; 18 | 19 | $dark: #1e293b; 20 | 21 | // $positive: #21ba45; 22 | // $negative: #c10015; 23 | // $info: #31ccec; 24 | // $warning: #f2c037; 25 | -------------------------------------------------------------------------------- /ui/src/index.template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%= productName %> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 58 | 59 | 60 | 61 | 62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /ui/src/layouts/MainLayout.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 32 | -------------------------------------------------------------------------------- /ui/src/pages/Error401.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | -------------------------------------------------------------------------------- /ui/src/pages/Error403.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | -------------------------------------------------------------------------------- /ui/src/pages/Error404.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /ui/src/pages/Index.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 44 | -------------------------------------------------------------------------------- /ui/src/pages/accounts/change-password.vue: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 81 | -------------------------------------------------------------------------------- /ui/src/pages/accounts/send-notification.vue: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 77 | -------------------------------------------------------------------------------- /ui/src/pages/metas/meta.js: -------------------------------------------------------------------------------- 1 | import { Handler } from './../../services/Handler' 2 | 3 | const Meta = { 4 | name: 'Metas', 5 | module: 'metas', 6 | moduleName: null, 7 | keyLabel: 'name', // properties for getter value of display subtitle in detail 8 | searchBy: ['type','slug'], // define the specific column for global search 9 | // withRelation will overide relation mapping in API, if you want to default follow API setting, just set [] 10 | withRelation: [], // including specific relation data when fetching 11 | topBarMenu: [], 12 | permission: null, 13 | model: { 14 | id: null, 15 | type: 'string', 16 | slug: null, 17 | name: null, 18 | value: null, 19 | description: null, 20 | remarks: null, 21 | 22 | }, 23 | columns: [ 24 | { name: 'action', label: '#', align: 'left', width: '20px', searchable: false }, 25 | { name: 'type', label: 'Type', field: 'type', search: 'type', align: 'left', sort: 'asc' }, 26 | { name: 'slug', label: 'Slug', field: 'slug', search: 'slug', align: 'left', sort: 'asc' }, 27 | { name: 'name', label: 'Name', field: 'name', search: 'name', align: 'left', sort: 'asc' }, 28 | { name: 'value', label: 'Value', field: 'value', search: 'value', align: 'left', sort: 'asc' }, 29 | { name: 'description', label: 'Description', field: 'description', search: 'description', align: 'left', sort: 'asc' }, 30 | { name: 'remarks', label: 'Remarks', field: 'remarks', search: 'remarks', align: 'left', sort: 'asc' }, 31 | { name: 'log_data', label: 'Log', field: 'log_data', searchable: false }, 32 | ] 33 | } 34 | 35 | Meta.moduleName = Handler.makeModuleName(Meta.module) 36 | 37 | Meta.permission = { 38 | browse: Handler.permissionPage(`${Meta.module} browse`), 39 | create: Handler.permissionPage(`${Meta.module} create`), 40 | read: Handler.permissionPage(`${Meta.module} read`), 41 | update: Handler.permissionPage(`${Meta.module} update`), 42 | delete: Handler.permissionPage(`${Meta.module} delete`), 43 | restore: Handler.permissionPage(`${Meta.module} restore`), 44 | } 45 | 46 | // uncomment this if you want to allow all permission / disable permission handler feature 47 | // Meta.permission = Handler.makeAllPermissionAllowed(Meta.permission) 48 | 49 | export default Meta 50 | -------------------------------------------------------------------------------- /ui/src/pages/permissions/meta.js: -------------------------------------------------------------------------------- 1 | import { Handler } from './../../services/Handler' 2 | 3 | const Meta = { 4 | name: 'Permissions', 5 | module: 'permissions', 6 | moduleName: null, 7 | keyLabel: 'name', // properties for getter value of display subtitle in detail 8 | searchBy: ['module','name'], // define the specific column for global search 9 | // withRelation will overide relation mapping in API, if you want to default follow API setting, just set [] 10 | withRelation: [], // including specific relation data when fetching 11 | topBarMenu: [], 12 | permission: null, 13 | model: { 14 | id: null, 15 | module: null, 16 | name: null, 17 | 18 | }, 19 | columns: [ 20 | { name: 'action', label: '#', align: 'left', width: '20px', searchable: false }, 21 | { name: 'module', label: 'Module', field: 'module', search: 'module', align: 'left', sort: 'asc' }, 22 | { name: 'name', label: 'Name', field: 'name', search: 'name', align: 'left', sort: 'asc' }, 23 | { name: 'log_data', label: 'Log', field: 'log_data', searchable: false }, 24 | ] 25 | } 26 | 27 | Meta.moduleName = Handler.makeModuleName(Meta.module) 28 | 29 | Meta.permission = { 30 | browse: Handler.permissionPage(`${Meta.module} browse`), 31 | create: Handler.permissionPage(`${Meta.module} create`), 32 | read: Handler.permissionPage(`${Meta.module} read`), 33 | update: Handler.permissionPage(`${Meta.module} update`), 34 | delete: Handler.permissionPage(`${Meta.module} delete`), 35 | restore: Handler.permissionPage(`${Meta.module} restore`), 36 | } 37 | 38 | // uncomment this if you want to allow all permission / disable permission handler feature 39 | // Meta.permission = Handler.makeAllPermissionAllowed(Meta.permission) 40 | 41 | export default Meta 42 | -------------------------------------------------------------------------------- /ui/src/pages/role-groups/meta.js: -------------------------------------------------------------------------------- 1 | import { Handler } from './../../services/Handler' 2 | 3 | const Meta = { 4 | name: 'Role Groups', 5 | module: 'role-groups', 6 | moduleName: null, 7 | keyLabel: 'name', // properties for getter value of display subtitle in detail 8 | searchBy: ['name'], // define the specific column for global search 9 | // withRelation will overide relation mapping in API, if you want to default follow API setting, just set [] 10 | withRelation: [], // including specific relation data when fetching 11 | topBarMenu: [], 12 | permission: null, 13 | model: { 14 | id: null, 15 | name: null, 16 | 17 | }, 18 | columns: [ 19 | { name: 'action', label: '#', align: 'left', width: '20px', searchable: false }, 20 | { name: 'name', label: 'Name', field: 'name', search: 'name', align: 'left', sort: 'asc' }, 21 | { name: 'log_data', label: 'Log', field: 'log_data', searchable: false }, 22 | ] 23 | } 24 | 25 | Meta.moduleName = Handler.makeModuleName(Meta.module) 26 | 27 | Meta.permission = { 28 | browse: Handler.permissionPage(`${Meta.module} browse`), 29 | create: Handler.permissionPage(`${Meta.module} create`), 30 | read: Handler.permissionPage(`${Meta.module} read`), 31 | update: Handler.permissionPage(`${Meta.module} update`), 32 | delete: Handler.permissionPage(`${Meta.module} delete`), 33 | restore: Handler.permissionPage(`${Meta.module} restore`), 34 | } 35 | 36 | // uncomment this if you want to allow all permission / disable permission handler feature 37 | // Meta.permission = Handler.makeAllPermissionAllowed(Meta.permission) 38 | 39 | export default Meta 40 | -------------------------------------------------------------------------------- /ui/src/pages/roles/meta.js: -------------------------------------------------------------------------------- 1 | import { Handler } from './../../services/Handler' 2 | 3 | const Meta = { 4 | name: 'Roles', 5 | module: 'roles', 6 | moduleName: null, 7 | keyLabel: 'id', // properties for getter value of display subtitle in detail 8 | searchBy: ['name'], // define the specific column for global search 9 | withRelation: ['RoleGroup'], // including specific relation data when fetching 10 | topBarMenu: [], 11 | permission: null, 12 | model: { 13 | id: null, 14 | role_group_id: null, 15 | name: null, 16 | slug: null, 17 | dataModel: null, 18 | 19 | }, 20 | columns: [ 21 | { name: 'action', label: '#', align: 'left', width: '20px', searchable: false }, 22 | { name: 'role_group_id', label: 'Role Group', field: 'role_group', search: 'RoleGroup.id', align: 'left', sort: 'asc', format: val => val ? val.name : '-' }, 23 | { name: 'name', label: 'Name', field: 'name', search: 'name', align: 'left', sort: 'asc' }, 24 | { name: 'slug', label: 'Slug', field: 'slug', search: 'slug', align: 'left', sort: 'asc' }, 25 | { name: 'log_data', label: 'Log', field: 'log_data', searchable: false }, 26 | ] 27 | } 28 | 29 | Meta.moduleName = Handler.makeModuleName(Meta.module) 30 | 31 | Meta.permission = { 32 | browse: Handler.permissionPage(`${Meta.module} browse`), 33 | create: Handler.permissionPage(`${Meta.module} create`), 34 | read: Handler.permissionPage(`${Meta.module} read`), 35 | update: Handler.permissionPage(`${Meta.module} update`), 36 | delete: Handler.permissionPage(`${Meta.module} delete`), 37 | restore: Handler.permissionPage(`${Meta.module} restore`), 38 | } 39 | 40 | // uncomment this if you want to allow all permission / disable permission handler feature 41 | // Meta.permission = Handler.makeAllPermissionAllowed(Meta.permission) 42 | 43 | export default Meta 44 | -------------------------------------------------------------------------------- /ui/src/pages/users/meta.js: -------------------------------------------------------------------------------- 1 | import { Handler } from './../../services/Handler' 2 | 3 | const Meta = { 4 | name: 'Users', 5 | module: 'users', 6 | moduleName: null, 7 | keyLabel: 'name', // properties for getter value of display subtitle in detail 8 | searchBy: ['name', 'email'], // define the specific column for global search 9 | withRelation: ['Role'], // including specific relation data when fetching 10 | topBarMenu: [], 11 | permission: null, 12 | model: { 13 | id: null, 14 | name: null, 15 | username: null, 16 | password: null, 17 | email: null, 18 | email_verified_at: null, 19 | remember_token: null, 20 | picture: null, 21 | is_ban: false 22 | 23 | }, 24 | columns: [ 25 | { name: 'action', label: '#', align: 'left', width: '20px', searchable: false }, 26 | { name: 'name', label: 'Name', field: 'name', search: 'name', align: 'left', sort: 'asc'}, 27 | { name: 'email', label: 'Email', field: 'email', search: 'email', align: 'left', sort: 'asc' }, 28 | { name: 'username', label: 'username', field: 'username', search: 'username', align: 'left', sort: 'asc' }, 29 | { name: 'email_verified_at', label: 'Email Verified At', field: 'email_verified_at', search: 'email_verified_at', align: 'left'}, 30 | { name: 'role_id', label: 'Role', field: 'role', search: 'Role.name', align: 'left', sort: 'asc', format: val => val ? val.name : '' }, 31 | { name: 'log_data', label: 'Log', field: 'log_data', align: 'left', searchable: false }, 32 | 33 | ] 34 | } 35 | 36 | Meta.moduleName = Handler.makeModuleName(Meta.module) 37 | 38 | Meta.permission = { 39 | browse: Handler.permissionPage(`${Meta.module} browse`), 40 | create: Handler.permissionPage(`${Meta.module} create`), 41 | read: Handler.permissionPage(`${Meta.module} read`), 42 | update: Handler.permissionPage(`${Meta.module} update`), 43 | delete: Handler.permissionPage(`${Meta.module} delete`), 44 | restore: Handler.permissionPage(`${Meta.module} restore`), 45 | } 46 | 47 | // uncomment this if you want to allow all permission / disable permission handler feature 48 | // Meta.permission = Handler.makeAllPermissionAllowed(Meta.permission) 49 | 50 | export default Meta 51 | -------------------------------------------------------------------------------- /ui/src/quasar.d.ts: -------------------------------------------------------------------------------- 1 | // Forces TS to apply `@quasar/app` augmentations of `quasar` package 2 | // Removing this would break `quasar/wrappers` imports as those typings are declared 3 | // into `@quasar/app` 4 | // As a side effect, since `@quasar/app` reference `quasar` to augment it, 5 | // this declaration also apply `quasar` own 6 | // augmentations (eg. adds `$q` into Vue component context) 7 | /// 8 | -------------------------------------------------------------------------------- /ui/src/router/index.js: -------------------------------------------------------------------------------- 1 | import { route } from "quasar/wrappers"; 2 | import { 3 | createRouter, 4 | createMemoryHistory, 5 | createWebHistory, 6 | createWebHashHistory, 7 | } from "vue-router"; 8 | import routes from "./routes"; 9 | 10 | /* 11 | * If not building with SSR mode, you can 12 | * directly export the Router instantiation; 13 | * 14 | * The function below can be async too; either use 15 | * async/await or return a Promise which resolves 16 | * with the Router instance. 17 | */ 18 | 19 | export default route(function (/* { store, ssrContext } */) { 20 | const createHistory = process.env.SERVER 21 | ? createMemoryHistory 22 | : process.env.VUE_ROUTER_MODE === "history" 23 | ? createWebHistory 24 | : createWebHashHistory; 25 | 26 | const Router = createRouter({ 27 | scrollBehavior: () => ({ left: 0, top: 0 }), 28 | routes, 29 | 30 | // Leave this as is and make changes in quasar.conf.js instead! 31 | // quasar.conf.js -> build -> vueRouterMode 32 | // quasar.conf.js -> build -> publicPath 33 | history: createHistory( 34 | process.env.MODE === "ssr" ? void 0 : process.env.VUE_ROUTER_BASE 35 | ), 36 | }); 37 | 38 | return Router; 39 | }); 40 | -------------------------------------------------------------------------------- /ui/src/router/routes.js: -------------------------------------------------------------------------------- 1 | // CUSTOM REGISTER ROUTE 2 | const customRoutes = [ 3 | { 4 | name: 'login', 5 | path: '/login', 6 | component: () => import('layouts/Login.vue') 7 | }, 8 | { 9 | path: "/", 10 | component: () => import("layouts/MainLayout.vue"), 11 | children: [ 12 | { name: 'home', path: "/", component: () => import("pages/Index.vue") }, 13 | { name: '401', path: "/401", component: () => import("pages/Error401.vue") }, 14 | { name: '403', path: "/403", component: () => import("pages/Error403.vue") }, 15 | { name: '404', path: "/404", component: () => import("pages/Error404.vue") }, 16 | { name: 'example', path: "/example", component: () => import("pages/example.vue") }, 17 | { name: 'generator', path: "/generator", component: () => import("pages/generator.vue") }, 18 | { name: 'settings', path: "/settings", component: () => import("pages/settings.vue") }, 19 | // accounts 20 | { name: 'update-profile', path: '/me/update-profile', component: () => import('../pages/accounts/update-profile.vue') }, 21 | { name: 'change-password', path: '/me/change-password', component: () => import('../pages/accounts/change-password.vue') }, 22 | { name: 'notifications', path: '/me/notifications', component: () => import('../pages/accounts/notifications.vue') }, 23 | 24 | ], 25 | }, 26 | ] 27 | 28 | // AUTO REGISTER ROUTE 29 | // define the value as in Meta.module on the page you want to create an autoregsiter 30 | const moduleList = [ 31 | 'metas', 32 | 'users', 33 | 'permissions', 34 | 'role-permissions', 35 | 'role-groups', 36 | 'roles', 37 | 'metas', 38 | ] 39 | 40 | var autoRegisterRoute = moduleList.map(name => { 41 | var obj = { 42 | path: '/' + name, 43 | component: () => import('layouts/MainLayout.vue'), 44 | children: [ 45 | { name: `${name}`, path: `/${name}`, component: () => import(`pages/${name}/index.vue`) }, 46 | { name: `${name}-detail`, path: `/${name}/:id`, component: () => import(`pages/${name}/detail.vue`) }, 47 | { name: `${name}-add`, path: `/${name}/form`, component: () => import(`pages/${name}/form.vue`) }, 48 | { name: `${name}-edit`, path: `/${name}/form/:id`, component: () => import(`pages/${name}/form.vue`) } 49 | ] 50 | } 51 | 52 | // console.log('AutoRegRoutes:', name) 53 | return obj 54 | 55 | }) 56 | 57 | // FIX ROUTES 58 | const routes = [ 59 | ...autoRegisterRoute, 60 | ...customRoutes, 61 | // handle 404 automaticaly 62 | { 63 | path: '/:catchAll(.*)*', 64 | redirect: to => { 65 | const path = window.location.href 66 | console.log('to', to) 67 | // console.log('path', path) 68 | if (to.path.includes('api')) { 69 | window.location.href = `https://ExampleURL.com/` 70 | // return '/e/404'; 71 | } else { 72 | return '/404'; 73 | } 74 | } 75 | // component: () => import('pages/Error404.vue') 76 | } 77 | ] 78 | 79 | export default routes 80 | -------------------------------------------------------------------------------- /ui/src/services/BuildRoute.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | export const BuildRoute = { 4 | 5 | export (routes) { 6 | // console.log(routes) 7 | const data = [] 8 | routes.map(r => { 9 | const route = { name: r.name, path: r.path } 10 | if (r.name) data.push(route) 11 | }) 12 | 13 | data.sort((a, b) => { 14 | const nameA = (a.name || '').toUpperCase() // Convert undefined to an empty string 15 | const nameB = (b.name || '').toUpperCase() 16 | if (nameA < nameB) return -1 17 | if (nameA > nameB) return 1 18 | return 0 19 | }) 20 | 21 | const jsonContent = JSON.stringify(data, null, 2) // null dan 2 digunakan untuk indentasi yang lebih mudah dibaca 22 | const blob = new Blob([jsonContent], { type: 'application/json' }) 23 | const url = window.URL.createObjectURL(blob) 24 | const link = document.createElement('a') 25 | link.href = url 26 | link.download = 'ui_route.json' 27 | link.click() 28 | window.URL.revokeObjectURL(url) 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | --------------------------------------------------------------------------------