├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Console │ ├── Commands │ │ └── CreateRoutePermissionsCommand.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ConfirmPasswordController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ ├── ResetPasswordController.php │ │ │ └── VerificationController.php │ │ ├── Controller.php │ │ ├── HomeController.php │ │ ├── PermissionsController.php │ │ ├── ProfileController.php │ │ ├── RolesController.php │ │ └── UsersController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PermissionMiddleware.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ ├── ValidateSignature.php │ │ └── VerifyCsrfToken.php │ └── Requests │ │ ├── ProfileUpdateRequest.php │ │ ├── RegisterRequest.php │ │ └── StoreUserRequest.php ├── Models │ ├── Admin.php │ ├── Presenters │ │ └── UserPresenter.php │ ├── Traits │ │ └── HasHashedMediaTrait.php │ ├── User.php │ └── Userprofile.php └── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── debugbar.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── media-library.php ├── permission.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_reset_tokens_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ └── 2023_02_17_034249_create_permission_tables.php └── seeders │ ├── DatabaseSeeder.php │ └── UserSeeder.php ├── docker-compose.yml ├── docker ├── my.cnf └── php.ini ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── icons │ ├── brand.svg │ └── coreui.svg ├── img │ └── default-avatar.jpg ├── index.php ├── js │ ├── coreui.bundle.min.js │ └── jquery.min.js └── robots.txt ├── resources ├── js │ ├── app.js │ └── bootstrap.js ├── sass │ ├── _custom.scss │ ├── _layout.scss │ ├── _variables.scss │ ├── app.scss │ └── coreui │ │ ├── _custom.scss │ │ ├── _layout.scss │ │ ├── _variables.scss │ │ ├── examples.scss │ │ ├── style.scss │ │ └── vendors │ │ └── simplebar.scss └── views │ ├── about.blade.php │ ├── auth │ ├── login.blade.php │ ├── passwords │ │ ├── confirm.blade.php │ │ ├── email.blade.php │ │ └── reset.blade.php │ ├── profile.blade.php │ ├── register.blade.php │ └── verify.blade.php │ ├── dashboard.blade.php │ ├── home.blade.php │ ├── layouts │ ├── app.blade.php │ ├── guest.blade.php │ ├── includes │ │ ├── errors.blade.php │ │ ├── footer.blade.php │ │ ├── header.blade.php │ │ ├── messages.blade.php │ │ └── show.blade.php │ └── navigation.blade.php │ ├── permissions │ ├── create.blade.php │ ├── edit.blade.php │ └── index.blade.php │ ├── roles │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ └── show.blade.php │ ├── settings │ ├── fields │ │ ├── checkbox.blade.php │ │ ├── email.blade.php │ │ ├── number.blade.php │ │ ├── select.blade.php │ │ ├── text.blade.php │ │ └── textarea.blade.php │ └── index.blade.php │ ├── users │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ └── show.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── debugbar │ └── .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 └── 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 | APP_PORT=80 12 | FORWARD_DB_PORT=3306 13 | WWWGROUP=1000 14 | WWWUSER=1000 15 | 16 | DB_CONNECTION=mysql 17 | DB_HOST=127.0.0.1 18 | DB_PORT=3306 19 | DB_DATABASE=laravel 20 | DB_USERNAME=root 21 | DB_PASSWORD=root123 22 | 23 | BROADCAST_DRIVER=log 24 | CACHE_DRIVER=file 25 | FILESYSTEM_DISK=local 26 | QUEUE_CONNECTION=sync 27 | SESSION_DRIVER=file 28 | SESSION_LIFETIME=120 29 | 30 | MEMCACHED_HOST=127.0.0.1 31 | 32 | REDIS_HOST=127.0.0.1 33 | REDIS_PASSWORD=null 34 | REDIS_PORT=6379 35 | 36 | MAIL_MAILER=smtp 37 | MAIL_HOST=mailpit 38 | MAIL_PORT=1025 39 | MAIL_USERNAME=null 40 | MAIL_PASSWORD=null 41 | MAIL_ENCRYPTION=null 42 | MAIL_FROM_ADDRESS="hello@example.com" 43 | MAIL_FROM_NAME="${APP_NAME}" 44 | 45 | AWS_ACCESS_KEY_ID= 46 | AWS_SECRET_ACCESS_KEY= 47 | AWS_DEFAULT_REGION=us-east-1 48 | AWS_BUCKET= 49 | AWS_USE_PATH_STYLE_ENDPOINT=false 50 | 51 | PUSHER_APP_ID= 52 | PUSHER_APP_KEY= 53 | PUSHER_APP_SECRET= 54 | PUSHER_HOST= 55 | PUSHER_PORT=443 56 | PUSHER_SCHEME=https 57 | PUSHER_APP_CLUSTER=mt1 58 | 59 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 60 | VITE_PUSHER_HOST="${PUSHER_HOST}" 61 | VITE_PUSHER_PORT="${PUSHER_PORT}" 62 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 63 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 64 | -------------------------------------------------------------------------------- /.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 | /storage/*.key 7 | /vendor 8 | .env 9 | .env.backup 10 | .env.production 11 | Homestead.json 12 | Homestead.yaml 13 | auth.json 14 | npm-debug.log 15 | yarn-error.log 16 | /.fleet 17 | /.idea 18 | /.vscode 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Laravel Logo

2 | 3 | 4 | ## Laravel 11.x ready to start project 5 | 6 | You may save your time to setup your project. You can start your project using this template where we have used Laravel 11.x and CoreUI out of the box Bootstrap. 7 | 8 | ## Laravel 11 9 | As you may know, Laravel transitioned to yearly releases with the release of Laravel 10. Previously, major versions were released every 6 months. This transition is intended to ease the maintenance burden on the community and challenge our development team to ship amazing, powerful new features without introducing breaking changes. Therefore, we have shipped a variety of robust features to Laravel 9 without breaking backwards compatibility. 10 | 11 | Therefore, this commitment to ship great new features during the current release will likely lead to future "major" releases being primarily used for "maintenance" tasks such as upgrading upstream dependencies, which can be seen in these release notes. 12 | 13 | Laravel 11 continues the improvements made in Laravel 10.x by introducing argument and return types to all application skeleton methods, as well as all stub files used to generate classes throughout the framework. In addition, a new, developer-friendly abstraction layer has been introduced for starting and interacting with external processes. Further, Laravel Pennant has been introduced to provide a wonderful approach to managing your application's "feature flags". 14 | 15 | ## PHP 8.2.0 or greater. 16 | Laravel 11.x requires a minimum PHP version of 8.2.0 or greater. 17 | 18 | ## curl 7.34.0 Required 19 | Laravel's HTTP client now requires curl 7.34.0 or greater. 20 | 21 | 22 | ## Features 23 | 24 | * User Authentication 25 | * Role-Permissions for Users 26 | * Bootstrap 5, CoreUI 27 | * Landing Page 28 | * Tailwind 29 | 30 | 31 | # User Guide 32 | 33 | ## Installation 34 | 35 | Follow the steps mentioned below to install and run the project. 36 | 37 | 1. Clone or download the repository 38 | 2. Go to the project directory (cd laavel-coreui) and run `composer install` and `npm install` 39 | 1. It will install all the laravel (PHP) packages by the command `composer install` (if you do not have `composer` then install it - https://getcomposer.org/download/) 40 | 2. It will install all the NPM packages by the command `npm install` (if you do not have npm then install it - https://nodejs.org/en/download) 41 | 3. Create `.env` file by copying the `.env.example`. You may use the command to do that `cp .env.example .env` 42 | 4. Run the command `composer run-script post-create-project-cmd` to APP_KEY 43 | 5. Update the database name and credentials in `.env` file 44 | 6. Run the command `php artisan migrate --seed` 45 | 7. Run the command `php artisan db:seed --class=UserSeeder` to create user, it will generate super admin `super@admin.com` and the password is `secret` 46 | 8. Link storage directory: `php artisan storage:link` 47 | 9. You may create a virtualhost entry to access the application or run `php artisan serve` from the project root and visit `http://127.0.0.1:8000` 48 | 49 | OR 50 | 51 | Using the Docker, you may run the project 52 | 53 | 1. docker-compose up 54 | 55 | Important note: if you get broken page then run the command `npm run dev` or `npm run build` 56 | 57 | # Screenshots 58 | Login View 59 | ![login](https://github.com/bilaschandra/laravel-coreui/assets/5582015/5ca1d995-90be-4e02-b3ee-693fad45b588) 60 | 61 | Dashboard View 62 | ![dashboard](https://github.com/bilaschandra/laravel-coreui/assets/5582015/9d233ac2-83e9-4668-8413-e6c150bc0b37) 63 | 64 | Users View 65 | ![User-List-Laravel](https://github.com/bilaschandra/laravel-coreui/assets/5582015/a3088739-7771-4264-9378-9523dcbfae35) 66 | 67 | Roles View 68 | ![Role-list-Laravel](https://github.com/bilaschandra/laravel-coreui/assets/5582015/2d1b52d2-63d0-40bd-b10a-5c07f2db169c) 69 | 70 | Permissions View 71 | ![Permission-List-Laravel](https://github.com/bilaschandra/laravel-coreui/assets/5582015/a69a3a8a-956f-4fe2-8c53-0e642ba8099d) 72 | 73 | ## Release 74 | 75 | ### Laravel 10 76 | Tags 77 | v1.0-beta 78 | v1.0.1 79 | ### Laravel 11 80 | Tags 81 | v2.0.0 82 | 83 | 84 | ## License 85 | 86 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). 87 | -------------------------------------------------------------------------------- /app/Console/Commands/CreateRoutePermissionsCommand.php: -------------------------------------------------------------------------------- 1 | getRoutes(); 46 | 47 | foreach ($routes as $route) { 48 | if ($route->getName() != '' && $route->getAction()['middleware']['0'] == 'web') { 49 | $permission = Permission::where('name', $route->getName())->first(); 50 | 51 | if (is_null($permission)) { 52 | permission::create(['name' => $route->getName()]); 53 | } 54 | } 55 | } 56 | 57 | $this->info('Permission routes added successfully.'); 58 | } 59 | } -------------------------------------------------------------------------------- /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/Auth/ConfirmPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 40 | } 41 | 42 | public function username() 43 | { 44 | return 'email'; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 42 | } 43 | 44 | /** 45 | * Get a validator for an incoming registration request. 46 | * 47 | * @param array $data 48 | * @return \Illuminate\Contracts\Validation\Validator 49 | */ 50 | protected function validator(array $data) 51 | { 52 | return Validator::make($data, [ 53 | 'first_name' => ['required', 'string', 'max:191'], 54 | 'last_name' => ['required', 'string', 'max:191'], 55 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 56 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 57 | ]); 58 | } 59 | 60 | /** 61 | * Create a new user instance after a valid registration. 62 | * 63 | * @param array $data 64 | * @return \App\Models\User 65 | */ 66 | protected function create(array $data) 67 | { 68 | $user = User::create([ 69 | 'first_name' => $data['first_name'], 70 | 'last_name' => $data['last_name'], 71 | 'name' => $data['first_name'].' '.$data['last_name'], 72 | 'email' => $data['email'], 73 | 'password' => Hash::make($data['password']), 74 | ]); 75 | 76 | $username = config('app.initial_username') + $user->id; 77 | $user->username = $username; 78 | $user->save(); 79 | 80 | return $user; 81 | } 82 | 83 | public function redirectTo() 84 | { 85 | return $this->redirectTo; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 39 | $this->middleware('signed')->only('verify'); 40 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Contracts\Support\Renderable 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | 29 | public function about() 30 | { 31 | return view('about'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Controllers/PermissionsController.php: -------------------------------------------------------------------------------- 1 | $permissions 22 | ]); 23 | } 24 | 25 | /** 26 | * Show form for creating permissions 27 | * 28 | * @return \Illuminate\Http\Response 29 | */ 30 | public function create() 31 | { 32 | return view('permissions.create'); 33 | } 34 | 35 | /** 36 | * Store a newly created resource in storage. 37 | * 38 | * @param \Illuminate\Http\Request $request 39 | * @return \Illuminate\Http\Response 40 | */ 41 | public function store(Request $request) 42 | { 43 | $request->validate([ 44 | 'name' => 'required|unique:users,name' 45 | ]); 46 | 47 | Permission::create($request->only('name')); 48 | 49 | return redirect()->route('permissions.index') 50 | ->withSuccess(__('Permission created successfully.')); 51 | } 52 | 53 | /** 54 | * Show the form for editing the specified resource. 55 | * 56 | * @param Permission $post 57 | * @return \Illuminate\Http\Response 58 | */ 59 | public function edit(Permission $permission) 60 | { 61 | return view('permissions.edit', [ 62 | 'permission' => $permission 63 | ]); 64 | } 65 | 66 | /** 67 | * Update the specified resource in storage. 68 | * 69 | * @param \Illuminate\Http\Request $request 70 | * @param Permission $permission 71 | * @return \Illuminate\Http\Response 72 | */ 73 | public function update(Request $request, Permission $permission) 74 | { 75 | $request->validate([ 76 | 'name' => 'required|unique:permissions,name,'.$permission->id 77 | ]); 78 | 79 | $permission->update($request->only('name')); 80 | 81 | return redirect()->route('permissions.index') 82 | ->withSuccess(__('Permission updated successfully.')); 83 | } 84 | 85 | /** 86 | * Remove the specified resource from storage. 87 | * 88 | * @param \App\Models\Post $post 89 | * @return \Illuminate\Http\Response 90 | */ 91 | public function destroy(Permission $permission) 92 | { 93 | $permission->delete(); 94 | 95 | return redirect()->route('permissions.index') 96 | ->withSuccess(__('Permission deleted successfully.')); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /app/Http/Controllers/ProfileController.php: -------------------------------------------------------------------------------- 1 | password) { 18 | auth()->user()->update(['password' => Hash::make($request->password)]); 19 | } 20 | 21 | auth()->user()->update([ 22 | 'name' => $request->name, 23 | 'email' => $request->email, 24 | ]); 25 | 26 | return redirect()->back()->with('success', 'Profile updated.'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/RolesController.php: -------------------------------------------------------------------------------- 1 | paginate(5); 32 | return view('roles.index',compact('roles')) 33 | ->with('i', ($request->input('page', 1) - 1) * 5); 34 | } 35 | 36 | /** 37 | * Show the form for creating a new resource. 38 | * 39 | * @return \Illuminate\Http\Response 40 | */ 41 | public function create() 42 | { 43 | $permissions = Permission::get(); 44 | return view('roles.create', compact('permissions')); 45 | } 46 | 47 | /** 48 | * Store a newly created resource in storage. 49 | * 50 | * @param \Illuminate\Http\Request $request 51 | * @return \Illuminate\Http\Response 52 | */ 53 | public function store(Request $request) 54 | { 55 | $this->validate($request, [ 56 | 'name' => 'required|unique:roles,name', 57 | 'permission' => 'required', 58 | ]); 59 | 60 | $role = Role::create(['name' => $request->get('name')]); 61 | $role->syncPermissions($request->get('permission')); 62 | 63 | return redirect()->route('roles.index') 64 | ->with('success','Role created successfully'); 65 | } 66 | 67 | /** 68 | * Display the specified resource. 69 | * 70 | * @param int $id 71 | * @return \Illuminate\Http\Response 72 | */ 73 | public function show(Role $role) 74 | { 75 | $role = $role; 76 | $rolePermissions = $role->permissions; 77 | 78 | return view('roles.show', compact('role', 'rolePermissions')); 79 | } 80 | 81 | /** 82 | * Show the form for editing the specified resource. 83 | * 84 | * @param int $id 85 | * @return \Illuminate\Http\Response 86 | */ 87 | public function edit(Role $role) 88 | { 89 | $role = $role; 90 | $rolePermissions = $role->permissions->pluck('name')->toArray(); 91 | $permissions = Permission::get(); 92 | 93 | return view('roles.edit', compact('role', 'rolePermissions', 'permissions')); 94 | } 95 | 96 | /** 97 | * Update the specified resource in storage. 98 | * 99 | * @param \Illuminate\Http\Request $request 100 | * @param int $id 101 | * @return \Illuminate\Http\Response 102 | */ 103 | public function update(Role $role, Request $request) 104 | { 105 | $this->validate($request, [ 106 | 'name' => 'required', 107 | 'permission' => 'required', 108 | ]); 109 | 110 | $role->update($request->only('name')); 111 | 112 | $role->syncPermissions($request->get('permission')); 113 | 114 | return redirect()->route('roles.index') 115 | ->with('success','Role updated successfully'); 116 | } 117 | 118 | /** 119 | * Remove the specified resource from storage. 120 | * 121 | * @param int $id 122 | * @return \Illuminate\Http\Response 123 | */ 124 | public function destroy(Role $role) 125 | { 126 | $role->delete(); 127 | 128 | return redirect()->route('roles.index') 129 | ->with('success','Role deleted successfully'); 130 | } 131 | } -------------------------------------------------------------------------------- /app/Http/Controllers/UsersController.php: -------------------------------------------------------------------------------- 1 | paginate(10); 24 | 25 | return view('users.index', compact('users')); 26 | } 27 | 28 | /** 29 | * Show form for creating user 30 | * 31 | * @return \Illuminate\Http\Response 32 | */ 33 | public function create() 34 | { 35 | return view('users.create'); 36 | } 37 | 38 | /** 39 | * Store a newly created user 40 | * 41 | * @param User $user 42 | * @param StoreUserRequest $request 43 | * 44 | * @return \Illuminate\Http\Response 45 | */ 46 | public function store(User $user, StoreUserRequest $request) 47 | { 48 | //For demo purposes only. When creating user or inviting a user 49 | // you should create a generated random password and email it to the user 50 | $user->create(array_merge($request->validated(), [ 51 | 'password' => 'test' 52 | ])); 53 | 54 | return redirect()->route('users.index') 55 | ->withSuccess(__('User created successfully.')); 56 | } 57 | 58 | /** 59 | * Show user data 60 | * 61 | * @param User $user 62 | * 63 | * @return \Illuminate\Http\Response 64 | */ 65 | public function show(User $user) 66 | { 67 | return view('users.show', [ 68 | 'user' => $user 69 | ]); 70 | } 71 | 72 | /** 73 | * Edit user data 74 | * 75 | * @param User $user 76 | * 77 | * @return \Illuminate\Http\Response 78 | */ 79 | public function edit(User $user) 80 | { 81 | return view('users.edit', [ 82 | 'user' => $user, 83 | 'userRole' => $user->roles->pluck('name')->toArray(), 84 | 'roles' => Role::latest()->get() 85 | ]); 86 | } 87 | 88 | /** 89 | * Update user data 90 | * 91 | * @param User $user 92 | * @param ProfileUpdateRequest $request 93 | * 94 | * @return \Illuminate\Http\Response 95 | */ 96 | public function update(User $user, ProfileUpdateRequest $request) 97 | { 98 | $user->update($request->validated()); 99 | 100 | $user->syncRoles($request->get('role')); 101 | 102 | return redirect()->route('users.index') 103 | ->withSuccess(__('User updated successfully.')); 104 | } 105 | 106 | /** 107 | * Delete user data 108 | * 109 | * @param User $user 110 | * 111 | * @return \Illuminate\Http\Response 112 | */ 113 | public function destroy(User $user) 114 | { 115 | $user->delete(); 116 | 117 | return redirect()->route('users.index') 118 | ->withSuccess(__('User deleted successfully.')); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /app/Http/Kernel.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 | // added role and permission middleware 67 | 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, 68 | 'permission' => \App\Http\Middleware\PermissionMiddleware::class, 69 | 'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class, 70 | ]; 71 | } 72 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson() ? null : route('login'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/PermissionMiddleware.php: -------------------------------------------------------------------------------- 1 | guard($guard); 21 | 22 | if ($authGuard->guest()) { 23 | throw UnauthorizedException::notLoggedIn(); 24 | } 25 | 26 | if (! is_null($permission)) { 27 | $permissions = is_array($permission) 28 | ? $permission 29 | : explode('|', $permission); 30 | } 31 | 32 | if ( is_null($permission) ) { 33 | $permission = $request->route()->getName(); 34 | 35 | $permissions = array($permission); 36 | } 37 | 38 | 39 | foreach ($permissions as $permission) { 40 | if ($authGuard->user()->can($permission)) { 41 | return $next($request); 42 | } 43 | } 44 | 45 | throw UnauthorizedException::forPermissions($permissions); 46 | } 47 | } -------------------------------------------------------------------------------- /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/Http/Requests/ProfileUpdateRequest.php: -------------------------------------------------------------------------------- 1 | route('user'); 28 | 29 | return [ 30 | 'name' => 'required', 31 | 'email' => 'required|email:rfc,dns|unique:users,email,'.$user->id, 32 | 'username' => 'required|unique:users,username,'.$user->id, 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Requests/RegisterRequest.php: -------------------------------------------------------------------------------- 1 | 'required|email:rfc,dns|unique:users,email', 28 | 'username' => 'required|unique:users,username', 29 | 'password' => 'required|min:8', 30 | 'password_confirmation' => 'required|same:password' 31 | ]; 32 | } 33 | } -------------------------------------------------------------------------------- /app/Http/Requests/StoreUserRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | 'email' => 'required|email:rfc,dns|unique:users,email', 29 | 'username' => 'required|unique:users,username', 30 | ]; 31 | } 32 | } -------------------------------------------------------------------------------- /app/Models/Admin.php: -------------------------------------------------------------------------------- 1 | 'datetime', 46 | ]; 47 | 48 | public static function getpermissionGroups() 49 | { 50 | $permission_groups = DB::table('permissions') 51 | ->select('group_name as name') 52 | ->groupBy('group_name') 53 | ->get(); 54 | return $permission_groups; 55 | } 56 | 57 | public static function getpermissionsByGroupName($group_name) 58 | { 59 | $permissions = DB::table('permissions') 60 | ->select('name', 'id') 61 | ->where('group_name', $group_name) 62 | ->get(); 63 | return $permissions; 64 | } 65 | 66 | public static function roleHasPermissions($role, $permissions) 67 | { 68 | $hasPermission = true; 69 | foreach ($permissions as $permission) { 70 | if (!$role->hasPermissionTo($permission->name)) { 71 | $hasPermission = false; 72 | return $hasPermission; 73 | } 74 | } 75 | return $hasPermission; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/Models/Presenters/UserPresenter.php: -------------------------------------------------------------------------------- 1 | status) { 22 | case '1': 23 | return 'Active'; 24 | break; 25 | case '2': 26 | return 'Blocked'; 27 | break; 28 | 29 | default: 30 | return 'Status:'.$this->status.''; 31 | break; 32 | } 33 | } 34 | 35 | /** 36 | * Get Status Label. 37 | * 38 | * @return [type] [description] 39 | */ 40 | public function getConfirmedLabelAttribute() 41 | { 42 | if ($this->email_verified_at != null) { 43 | return 'Confirmed'; 44 | } else { 45 | return 'Not Confirmed'; 46 | } 47 | } 48 | 49 | /** 50 | * Cache Permissions Query. 51 | */ 52 | public function getPermissionsAttribute() 53 | { 54 | $permissions = Cache::rememberForever('permissions_cache', function () { 55 | return Permission::select('permissions.*', 'model_has_permissions.*') 56 | ->join('model_has_permissions', 'permissions.id', '=', 'model_has_permissions.permission_id') 57 | ->get(); 58 | }); 59 | 60 | return $permissions->where('model_id', $this->id); 61 | } 62 | 63 | /** 64 | * Cache Roles Query. 65 | */ 66 | public function getRolesAttribute() 67 | { 68 | $roles = Cache::rememberForever('roles_cache', function () { 69 | return Role::select('roles.*', 'model_has_roles.*') 70 | ->join('model_has_roles', 'roles.id', '=', 'model_has_roles.role_id') 71 | ->get(); 72 | }); 73 | 74 | return $roles->where('model_id', $this->id); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/Models/Traits/HasHashedMediaTrait.php: -------------------------------------------------------------------------------- 1 | parentAddMedia($file)->usingFileName($file->hashName()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\Models\User'); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.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 | $this->registerPolicies(); 25 | 26 | // 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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": "The Laravel Framework.", 5 | "keywords": ["framework", "laravel"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.2", 9 | "guzzlehttp/guzzle": "^7.2", 10 | "laravel/framework": "^11.0", 11 | "laravel/sanctum": "^4.0", 12 | "laravel/tinker": "^2.8", 13 | "laravel/ui": "^4.0", 14 | "spatie/laravel-medialibrary": "^11.9", 15 | "spatie/laravel-permission": "^6.0" 16 | }, 17 | "require-dev": { 18 | "barryvdh/laravel-debugbar": "^3.8", 19 | "fakerphp/faker": "^1.9.1", 20 | "laravel/pint": "^1.0", 21 | "laravel/sail": "^1.18", 22 | "laraveldaily/larastarters": "^2.2", 23 | "mockery/mockery": "^1.4.4", 24 | "nunomaduro/collision": "^8.1", 25 | "phpunit/phpunit": "^10.0", 26 | "spatie/laravel-ignition": "^2.0" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "App\\": "app/", 31 | "Database\\Factories\\": "database/factories/", 32 | "Database\\Seeders\\": "database/seeders/" 33 | } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "Tests\\": "tests/" 38 | } 39 | }, 40 | "scripts": { 41 | "post-autoload-dump": [ 42 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 43 | "@php artisan package:discover --ansi" 44 | ], 45 | "post-update-cmd": [ 46 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 47 | ], 48 | "post-root-package-install": [ 49 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 50 | ], 51 | "post-create-project-cmd": [ 52 | "@php artisan key:generate --ansi" 53 | ] 54 | }, 55 | "extra": { 56 | "branch-alias": { 57 | "dev-master": "10.x-dev" 58 | }, 59 | "laravel": { 60 | "dont-discover": [] 61 | } 62 | }, 63 | "config": { 64 | "optimize-autoloader": true, 65 | "preferred-install": "dist", 66 | "sort-packages": true, 67 | "allow-plugins": { 68 | "pestphp/pest-plugin": true 69 | } 70 | }, 71 | "minimum-stability": "stable", 72 | "prefer-stable": true 73 | } 74 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 'admin' => [ 44 | 'driver' => 'session', 45 | 'provider' => 'admins', 46 | ], 47 | ], 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | User Providers 52 | |-------------------------------------------------------------------------- 53 | | 54 | | All authentication drivers have a user provider. This defines how the 55 | | users are actually retrieved out of your database or other storage 56 | | mechanisms used by this application to persist your user's data. 57 | | 58 | | If you have multiple user tables or models you may configure multiple 59 | | sources which represent each model / table. These sources may then 60 | | be assigned to any extra authentication guards you have defined. 61 | | 62 | | Supported: "database", "eloquent" 63 | | 64 | */ 65 | 66 | 'providers' => [ 67 | 'users' => [ 68 | 'driver' => 'eloquent', 69 | 'model' => App\Models\User::class, 70 | ], 71 | 'admins' => [ 72 | 'driver' => 'eloquent', 73 | 'model' => App\Models\Admin::class, 74 | ], 75 | 76 | // 'users' => [ 77 | // 'driver' => 'database', 78 | // 'table' => 'users', 79 | // ], 80 | ], 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Resetting Passwords 85 | |-------------------------------------------------------------------------- 86 | | 87 | | You may specify multiple password reset configurations if you have more 88 | | than one user table or model in the application and you want to have 89 | | separate password reset settings based on the specific user types. 90 | | 91 | | The expire time is the number of minutes that each reset token will be 92 | | considered valid. This security feature keeps tokens short-lived so 93 | | they have less time to be guessed. You may change this as needed. 94 | | 95 | | The throttle setting is the number of seconds a user must wait before 96 | | generating more password reset tokens. This prevents the user from 97 | | quickly generating a very large amount of password reset tokens. 98 | | 99 | */ 100 | 101 | 'passwords' => [ 102 | 'users' => [ 103 | 'provider' => 'users', 104 | 'table' => 'password_reset_tokens', 105 | 'expire' => 60, 106 | 'throttle' => 60, 107 | ], 108 | ], 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Password Confirmation Timeout 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Here you may define the amount of seconds before a password confirmation 116 | | times out and the user is prompted to re-enter their password via the 117 | | confirmation screen. By default, the timeout lasts for three hours. 118 | | 119 | */ 120 | 121 | 'password_timeout' => 10800, 122 | 123 | ]; 124 | -------------------------------------------------------------------------------- /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/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | 'octane' => [ 92 | 'driver' => 'octane', 93 | ], 94 | 95 | ], 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Cache Key Prefix 100 | |-------------------------------------------------------------------------- 101 | | 102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 103 | | stores there might be other applications using the same cache. For 104 | | that reason, you may prefix every cache key to avoid collisions. 105 | | 106 | */ 107 | 108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /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/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', '127.0.0.1'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'forge'), 52 | 'username' => env('DB_USERNAME', 'forge'), 53 | 'password' => env('DB_PASSWORD', ''), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'search_path' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | // 'encrypt' => env('DB_ENCRYPT', 'yes'), 93 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), 94 | ], 95 | 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Migration Repository Table 101 | |-------------------------------------------------------------------------- 102 | | 103 | | This table keeps track of all the migrations that have already run for 104 | | your application. Using this information, we can determine which of 105 | | the migrations on disk haven't actually been run in the database. 106 | | 107 | */ 108 | 109 | 'migrations' => 'migrations', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Redis Databases 114 | |-------------------------------------------------------------------------- 115 | | 116 | | Redis is an open source, fast, and advanced key-value store that also 117 | | provides a richer body of commands than a typical key-value system 118 | | such as APC or Memcached. Laravel makes it easy to dig right in. 119 | | 120 | */ 121 | 122 | 'redis' => [ 123 | 124 | 'client' => env('REDIS_CLIENT', 'phpredis'), 125 | 126 | 'options' => [ 127 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 128 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 129 | ], 130 | 131 | 'default' => [ 132 | 'url' => env('REDIS_URL'), 133 | 'host' => env('REDIS_HOST', '127.0.0.1'), 134 | 'username' => env('REDIS_USERNAME'), 135 | 'password' => env('REDIS_PASSWORD'), 136 | 'port' => env('REDIS_PORT', '6379'), 137 | 'database' => env('REDIS_DB', '0'), 138 | ], 139 | 140 | 'cache' => [ 141 | 'url' => env('REDIS_URL'), 142 | 'host' => env('REDIS_HOST', '127.0.0.1'), 143 | 'username' => env('REDIS_USERNAME'), 144 | 'password' => env('REDIS_PASSWORD'), 145 | 'port' => env('REDIS_PORT', '6379'), 146 | 'database' => env('REDIS_CACHE_DB', '1'), 147 | ], 148 | 149 | ], 150 | 151 | ]; 152 | -------------------------------------------------------------------------------- /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/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Deprecations Log Channel 25 | |-------------------------------------------------------------------------- 26 | | 27 | | This option controls the log channel that should be used to log warnings 28 | | regarding deprecated PHP and library features. This allows you to get 29 | | your application ready for upcoming major versions of dependencies. 30 | | 31 | */ 32 | 33 | 'deprecations' => [ 34 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 35 | 'trace' => false, 36 | ], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Log Channels 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Here you may configure the log channels for your application. Out of 44 | | the box, Laravel uses the Monolog PHP logging library. This gives 45 | | you a variety of powerful log handlers / formatters to utilize. 46 | | 47 | | Available Drivers: "single", "daily", "slack", "syslog", 48 | | "errorlog", "monolog", 49 | | "custom", "stack" 50 | | 51 | */ 52 | 53 | 'channels' => [ 54 | 'stack' => [ 55 | 'driver' => 'stack', 56 | 'channels' => ['single'], 57 | 'ignore_exceptions' => false, 58 | ], 59 | 60 | 'single' => [ 61 | 'driver' => 'single', 62 | 'path' => storage_path('logs/laravel.log'), 63 | 'level' => env('LOG_LEVEL', 'debug'), 64 | ], 65 | 66 | 'daily' => [ 67 | 'driver' => 'daily', 68 | 'path' => storage_path('logs/laravel.log'), 69 | 'level' => env('LOG_LEVEL', 'debug'), 70 | 'days' => 14, 71 | ], 72 | 73 | 'slack' => [ 74 | 'driver' => 'slack', 75 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 76 | 'username' => 'Laravel Log', 77 | 'emoji' => ':boom:', 78 | 'level' => env('LOG_LEVEL', 'critical'), 79 | ], 80 | 81 | 'papertrail' => [ 82 | 'driver' => 'monolog', 83 | 'level' => env('LOG_LEVEL', 'debug'), 84 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 85 | 'handler_with' => [ 86 | 'host' => env('PAPERTRAIL_URL'), 87 | 'port' => env('PAPERTRAIL_PORT'), 88 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 89 | ], 90 | ], 91 | 92 | 'stderr' => [ 93 | 'driver' => 'monolog', 94 | 'level' => env('LOG_LEVEL', 'debug'), 95 | 'handler' => StreamHandler::class, 96 | 'formatter' => env('LOG_STDERR_FORMATTER'), 97 | 'with' => [ 98 | 'stream' => 'php://stderr', 99 | ], 100 | ], 101 | 102 | 'syslog' => [ 103 | 'driver' => 'syslog', 104 | 'level' => env('LOG_LEVEL', 'debug'), 105 | ], 106 | 107 | 'errorlog' => [ 108 | 'driver' => 'errorlog', 109 | 'level' => env('LOG_LEVEL', 'debug'), 110 | ], 111 | 112 | 'null' => [ 113 | 'driver' => 'monolog', 114 | 'handler' => NullHandler::class, 115 | ], 116 | 117 | 'emergency' => [ 118 | 'path' => storage_path('logs/laravel.log'), 119 | ], 120 | ], 121 | 122 | ]; 123 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array", "failover" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'local_domain' => env('MAIL_EHLO_DOMAIN'), 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | // 'client' => [ 55 | // 'timeout' => 5, 56 | // ], 57 | ], 58 | 59 | 'postmark' => [ 60 | 'transport' => 'postmark', 61 | // 'client' => [ 62 | // 'timeout' => 5, 63 | // ], 64 | ], 65 | 66 | 'sendmail' => [ 67 | 'transport' => 'sendmail', 68 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 69 | ], 70 | 71 | 'log' => [ 72 | 'transport' => 'log', 73 | 'channel' => env('MAIL_LOG_CHANNEL'), 74 | ], 75 | 76 | 'array' => [ 77 | 'transport' => 'array', 78 | ], 79 | 80 | 'failover' => [ 81 | 'transport' => 'failover', 82 | 'mailers' => [ 83 | 'smtp', 84 | 'log', 85 | ], 86 | ], 87 | ], 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Global "From" Address 92 | |-------------------------------------------------------------------------- 93 | | 94 | | You may wish for all e-mails sent by your application to be sent from 95 | | the same address. Here, you may specify a name and address that is 96 | | used globally for all e-mails that are sent by your application. 97 | | 98 | */ 99 | 100 | 'from' => [ 101 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 102 | 'name' => env('MAIL_FROM_NAME', 'Example'), 103 | ], 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Markdown Mail Settings 108 | |-------------------------------------------------------------------------- 109 | | 110 | | If you are using Markdown based email rendering, you may configure your 111 | | theme and component paths here, allowing you to customize the design 112 | | of the emails. Or, you may simply stick with the Laravel defaults! 113 | | 114 | */ 115 | 116 | 'markdown' => [ 117 | 'theme' => 'default', 118 | 119 | 'paths' => [ 120 | resource_path('views/vendor/mail'), 121 | ], 122 | ], 123 | 124 | ]; 125 | -------------------------------------------------------------------------------- /config/permission.php: -------------------------------------------------------------------------------- 1 | [ 6 | 7 | /* 8 | * When using the "HasPermissions" trait from this package, we need to know which 9 | * Eloquent model should be used to retrieve your permissions. Of course, it 10 | * is often just the "Permission" model but you may use whatever you like. 11 | * 12 | * The model you want to use as a Permission model needs to implement the 13 | * `Spatie\Permission\Contracts\Permission` contract. 14 | */ 15 | 16 | 'permission' => Spatie\Permission\Models\Permission::class, 17 | 18 | /* 19 | * When using the "HasRoles" trait from this package, we need to know which 20 | * Eloquent model should be used to retrieve your roles. Of course, it 21 | * is often just the "Role" model but you may use whatever you like. 22 | * 23 | * The model you want to use as a Role model needs to implement the 24 | * `Spatie\Permission\Contracts\Role` contract. 25 | */ 26 | 27 | 'role' => Spatie\Permission\Models\Role::class, 28 | 29 | ], 30 | 31 | 'table_names' => [ 32 | 33 | /* 34 | * When using the "HasRoles" trait from this package, we need to know which 35 | * table should be used to retrieve your roles. We have chosen a basic 36 | * default value but you may easily change it to any table you like. 37 | */ 38 | 39 | 'roles' => 'roles', 40 | 41 | /* 42 | * When using the "HasPermissions" trait from this package, we need to know which 43 | * table should be used to retrieve your permissions. We have chosen a basic 44 | * default value but you may easily change it to any table you like. 45 | */ 46 | 47 | 'permissions' => 'permissions', 48 | 49 | /* 50 | * When using the "HasPermissions" trait from this package, we need to know which 51 | * table should be used to retrieve your models permissions. We have chosen a 52 | * basic default value but you may easily change it to any table you like. 53 | */ 54 | 55 | 'model_has_permissions' => 'model_has_permissions', 56 | 57 | /* 58 | * When using the "HasRoles" trait from this package, we need to know which 59 | * table should be used to retrieve your models roles. We have chosen a 60 | * basic default value but you may easily change it to any table you like. 61 | */ 62 | 63 | 'model_has_roles' => 'model_has_roles', 64 | 65 | /* 66 | * When using the "HasRoles" trait from this package, we need to know which 67 | * table should be used to retrieve your roles permissions. We have chosen a 68 | * basic default value but you may easily change it to any table you like. 69 | */ 70 | 71 | 'role_has_permissions' => 'role_has_permissions', 72 | ], 73 | 74 | 'column_names' => [ 75 | /* 76 | * Change this if you want to name the related pivots other than defaults 77 | */ 78 | 'role_pivot_key' => null, //default 'role_id', 79 | 'permission_pivot_key' => null, //default 'permission_id', 80 | 81 | /* 82 | * Change this if you want to name the related model primary key other than 83 | * `model_id`. 84 | * 85 | * For example, this would be nice if your primary keys are all UUIDs. In 86 | * that case, name this `model_uuid`. 87 | */ 88 | 89 | 'model_morph_key' => 'model_id', 90 | 91 | /* 92 | * Change this if you want to use the teams feature and your related model's 93 | * foreign key is other than `team_id`. 94 | */ 95 | 96 | 'team_foreign_key' => 'team_id', 97 | ], 98 | 99 | /* 100 | * When set to true, the method for checking permissions will be registered on the gate. 101 | * Set this to false, if you want to implement custom logic for checking permissions. 102 | */ 103 | 104 | 'register_permission_check_method' => true, 105 | 106 | /* 107 | * When set to true the package implements teams using the 'team_foreign_key'. If you want 108 | * the migrations to register the 'team_foreign_key', you must set this to true 109 | * before doing the migration. If you already did the migration then you must make a new 110 | * migration to also add 'team_foreign_key' to 'roles', 'model_has_roles', and 111 | * 'model_has_permissions'(view the latest version of package's migration file) 112 | */ 113 | 114 | 'teams' => false, 115 | 116 | /* 117 | * When set to true, the required permission names are added to the exception 118 | * message. This could be considered an information leak in some contexts, so 119 | * the default setting is false here for optimum safety. 120 | */ 121 | 122 | 'display_permission_in_exception' => false, 123 | 124 | /* 125 | * When set to true, the required role names are added to the exception 126 | * message. This could be considered an information leak in some contexts, so 127 | * the default setting is false here for optimum safety. 128 | */ 129 | 130 | 'display_role_in_exception' => false, 131 | 132 | /* 133 | * By default wildcard permission lookups are disabled. 134 | */ 135 | 136 | 'enable_wildcard_permission' => false, 137 | 138 | 'cache' => [ 139 | 140 | /* 141 | * By default all permissions are cached for 24 hours to speed up performance. 142 | * When permissions or roles are updated the cache is flushed automatically. 143 | */ 144 | 145 | 'expiration_time' => \DateInterval::createFromDateString('24 hours'), 146 | 147 | /* 148 | * The cache key used to store all permissions. 149 | */ 150 | 151 | 'key' => 'spatie.permission.cache', 152 | 153 | /* 154 | * You may optionally indicate a specific cache driver to use for permission and 155 | * role caching using any of the `store` drivers listed in the cache.php config 156 | * file. Using 'default' here means to use the `default` set in cache.php. 157 | */ 158 | 159 | 'store' => 'default', 160 | ], 161 | ]; 162 | -------------------------------------------------------------------------------- /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/UserFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class UserFactory extends Factory 12 | { 13 | /** 14 | * Define the model's default state. 15 | * 16 | * @return array 17 | */ 18 | public function definition(): array 19 | { 20 | return [ 21 | 'name' => fake()->name(), 22 | 'email' => fake()->unique()->safeEmail(), 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | } 28 | 29 | /** 30 | * Indicate that the model's email address should be unverified. 31 | * 32 | * @return $this 33 | */ 34 | public function unverified(): static 35 | { 36 | return $this->state(fn (array $attributes) => [ 37 | 'email_verified_at' => null, 38 | ]); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('first_name'); 20 | $table->string('last_name'); 21 | $table->string('username')->nullable(); 22 | $table->string('email')->unique(); 23 | $table->string('mobile')->nullable(); 24 | $table->string('gender')->nullable(); 25 | $table->date('date_of_birth')->nullable(); 26 | $table->timestamp('email_verified_at')->nullable(); 27 | $table->string('password')->nullable(); 28 | $table->string('avatar')->nullable()->default('img/default-avatar.jpg'); 29 | $table->tinyInteger('status')->default(1)->unsigned(); 30 | $table->rememberToken(); 31 | $table->timestamps(); 32 | $table->softDeletes(); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::dropIfExists('users'); 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_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/2014_10_12_100000_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/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('uuid')->unique(); 17 | $table->text('connection'); 18 | $table->text('queue'); 19 | $table->longText('payload'); 20 | $table->longText('exception'); 21 | $table->timestamp('failed_at')->useCurrent(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('failed_jobs'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('tokenable'); 17 | $table->string('name'); 18 | $table->string('token', 64)->unique(); 19 | $table->text('abilities')->nullable(); 20 | $table->timestamp('last_used_at')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('personal_access_tokens'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/migrations/2023_02_17_034249_create_permission_tables.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); // permission id 30 | $table->string('name'); // For MySQL 8.0 use string('name', 125); 31 | $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125); 32 | $table->timestamps(); 33 | 34 | $table->unique(['name', 'guard_name']); 35 | }); 36 | 37 | Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) { 38 | $table->bigIncrements('id'); // role id 39 | if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing 40 | $table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable(); 41 | $table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index'); 42 | } 43 | $table->string('name'); // For MySQL 8.0 use string('name', 125); 44 | $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125); 45 | $table->timestamps(); 46 | if ($teams || config('permission.testing')) { 47 | $table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']); 48 | } else { 49 | $table->unique(['name', 'guard_name']); 50 | } 51 | }); 52 | 53 | Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) { 54 | $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission); 55 | 56 | $table->string('model_type'); 57 | $table->unsignedBigInteger($columnNames['model_morph_key']); 58 | $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index'); 59 | 60 | $table->foreign(PermissionRegistrar::$pivotPermission) 61 | ->references('id') // permission id 62 | ->on($tableNames['permissions']) 63 | ->onDelete('cascade'); 64 | if ($teams) { 65 | $table->unsignedBigInteger($columnNames['team_foreign_key']); 66 | $table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index'); 67 | 68 | $table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'], 69 | 'model_has_permissions_permission_model_type_primary'); 70 | } else { 71 | $table->primary([PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'], 72 | 'model_has_permissions_permission_model_type_primary'); 73 | } 74 | 75 | }); 76 | 77 | Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) { 78 | $table->unsignedBigInteger(PermissionRegistrar::$pivotRole); 79 | 80 | $table->string('model_type'); 81 | $table->unsignedBigInteger($columnNames['model_morph_key']); 82 | $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index'); 83 | 84 | $table->foreign(PermissionRegistrar::$pivotRole) 85 | ->references('id') // role id 86 | ->on($tableNames['roles']) 87 | ->onDelete('cascade'); 88 | if ($teams) { 89 | $table->unsignedBigInteger($columnNames['team_foreign_key']); 90 | $table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index'); 91 | 92 | $table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'], 93 | 'model_has_roles_role_model_type_primary'); 94 | } else { 95 | $table->primary([PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'], 96 | 'model_has_roles_role_model_type_primary'); 97 | } 98 | }); 99 | 100 | Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { 101 | $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission); 102 | $table->unsignedBigInteger(PermissionRegistrar::$pivotRole); 103 | 104 | $table->foreign(PermissionRegistrar::$pivotPermission) 105 | ->references('id') // permission id 106 | ->on($tableNames['permissions']) 107 | ->onDelete('cascade'); 108 | 109 | $table->foreign(PermissionRegistrar::$pivotRole) 110 | ->references('id') // role id 111 | ->on($tableNames['roles']) 112 | ->onDelete('cascade'); 113 | 114 | $table->primary([PermissionRegistrar::$pivotPermission, PermissionRegistrar::$pivotRole], 'role_has_permissions_permission_id_role_id_primary'); 115 | }); 116 | 117 | app('cache') 118 | ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null) 119 | ->forget(config('permission.cache.key')); 120 | } 121 | 122 | /** 123 | * Reverse the migrations. 124 | * 125 | * @return void 126 | */ 127 | public function down() 128 | { 129 | $tableNames = config('permission.table_names'); 130 | 131 | if (empty($tableNames)) { 132 | throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.'); 133 | } 134 | 135 | Schema::drop($tableNames['role_has_permissions']); 136 | Schema::drop($tableNames['model_has_roles']); 137 | Schema::drop($tableNames['model_has_permissions']); 138 | Schema::drop($tableNames['roles']); 139 | Schema::drop($tableNames['permissions']); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 16 | 17 | // \App\Models\User::factory()->create([ 18 | // 'name' => 'Test User', 19 | // 'email' => 'test@example.com', 20 | // ]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/seeders/UserSeeder.php: -------------------------------------------------------------------------------- 1 | 'Super', 27 | 'last_name' => 'Admin', 28 | 'name' => 'Super Admin', 29 | 'email' => 'super@admin.com', 30 | 'password' => Hash::make('secret'), 31 | 'username' => '100001', 32 | 'mobile' => $faker->phoneNumber, 33 | 'date_of_birth' => $faker->date, 34 | 'avatar' => 'img/default-avatar.jpg', 35 | 'gender' => $faker->randomElement(['Male', 'Female', 'Other']), 36 | 'email_verified_at' => Carbon::now(), 37 | 'created_at' => Carbon::now(), 38 | 'updated_at' => Carbon::now(), 39 | ], 40 | [ 41 | 'first_name' => 'Admin', 42 | 'last_name' => 'Istrator', 43 | 'name' => 'Admin Istrator', 44 | 'email' => 'admin@admin.com', 45 | 'password' => Hash::make('secret'), 46 | 'username' => '100002', 47 | 'mobile' => $faker->phoneNumber, 48 | 'date_of_birth' => $faker->date, 49 | 'avatar' => 'img/default-avatar.jpg', 50 | 'gender' => $faker->randomElement(['Male', 'Female', 'Other']), 51 | 'email_verified_at' => Carbon::now(), 52 | 'created_at' => Carbon::now(), 53 | 'updated_at' => Carbon::now(), 54 | ], 55 | [ 56 | 'first_name' => 'Manager', 57 | 'last_name' => 'User User', 58 | 'name' => 'Manager', 59 | 'email' => 'manager@manager.com', 60 | 'password' => Hash::make('secret'), 61 | 'username' => '100003', 62 | 'mobile' => $faker->phoneNumber, 63 | 'date_of_birth' => $faker->date, 64 | 'avatar' => 'img/default-avatar.jpg', 65 | 'gender' => $faker->randomElement(['Male', 'Female', 'Other']), 66 | 'email_verified_at' => Carbon::now(), 67 | 'created_at' => Carbon::now(), 68 | 'updated_at' => Carbon::now(), 69 | ], 70 | [ 71 | 'first_name' => 'Executive', 72 | 'last_name' => 'User', 73 | 'name' => 'Executive User', 74 | 'email' => 'executive@executive.com', 75 | 'password' => Hash::make('secret'), 76 | 'username' => '100004', 77 | 'mobile' => $faker->phoneNumber, 78 | 'date_of_birth' => $faker->date, 79 | 'avatar' => 'img/default-avatar.jpg', 80 | 'gender' => $faker->randomElement(['Male', 'Female', 'Other']), 81 | 'email_verified_at' => Carbon::now(), 82 | 'created_at' => Carbon::now(), 83 | 'updated_at' => Carbon::now(), 84 | ], 85 | [ 86 | 'first_name' => 'General', 87 | 'last_name' => 'User', 88 | 'name' => 'General User', 89 | 'email' => 'user@user.com', 90 | 'password' => Hash::make('secret'), 91 | 'username' => '100005', 92 | 'mobile' => $faker->phoneNumber, 93 | 'date_of_birth' => $faker->date, 94 | 'avatar' => 'img/default-avatar.jpg', 95 | 'gender' => $faker->randomElement(['Male', 'Female', 'Other']), 96 | 'email_verified_at' => Carbon::now(), 97 | 'created_at' => Carbon::now(), 98 | 'updated_at' => Carbon::now(), 99 | ], 100 | ]; 101 | 102 | foreach ($users as $user_data) { 103 | $user = User::create($user_data); 104 | } 105 | 106 | Schema::enableForeignKeyConstraints(); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # For more information: https://laravel.com/docs/sail 2 | version: '3' 3 | services: 4 | laravel: 5 | build: 6 | context: ./vendor/laravel/sail/runtimes/8.2 7 | dockerfile: Dockerfile 8 | args: 9 | WWWGROUP: '${WWWGROUP}' 10 | image: sail-8.3/app 11 | extra_hosts: 12 | - 'host.docker.internal:host-gateway' 13 | ports: 14 | - '${APP_PORT:-80}:80' 15 | - 5173:5173 16 | environment: 17 | WWWUSER: '${WWWUSER}' 18 | LARAVEL_SAIL: 1 19 | XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' 20 | XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' 21 | volumes: 22 | - '.:/var/www/html' 23 | - './docker/php.ini:/etc/php/8.1/cli/conf.d/99-sail.ini' 24 | networks: 25 | - laravel-coreui 26 | depends_on: 27 | - mysql 28 | # - redis 29 | mysql: 30 | image: bitnami/mysql:8.0.23 31 | ports: 32 | - '${FORWARD_DB_PORT:-3306}:3306' 33 | environment: 34 | MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' 35 | MYSQL_ROOT_HOST: "%" 36 | MYSQL_DATABASE: '${DB_DATABASE}' 37 | MYSQL_USER: '${DB_USERNAME}' 38 | MYSQL_PASSWORD: '${DB_PASSWORD}' 39 | MYSQL_ALLOW_EMPTY_PASSWORD: 1 40 | ALLOW_EMPTY_PASSWORD: 'yes' 41 | MYSQL_AUTHENTICATION_PLUGIN: 'mysql_native_password' 42 | volumes: 43 | - "./docker/my.cnf:/etc/mysql/my.cnf" 44 | - 'laravel-mysql:/var/lib/mysql' 45 | networks: 46 | - laravel-coreui 47 | # redis: 48 | # image: 'redis:alpine' 49 | # ports: 50 | # - '${FORWARD_REDIS_PORT:-6379}:6379' 51 | # volumes: 52 | # - 'laravel-redis:/data' 53 | # networks: 54 | # - laravel-coreui 55 | networks: 56 | laravel-coreui: 57 | driver: bridge 58 | volumes: 59 | laravel-mysql: 60 | driver: local 61 | laravel-redis: 62 | driver: local 63 | -------------------------------------------------------------------------------- /docker/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | general_log = 1 3 | general_log_file = /var/lib/mysql/general.log -------------------------------------------------------------------------------- /docker/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | max_execution_time = 300 3 | post_max_size = 1000M 4 | upload_max_filesize = 2000M 5 | variables_order = EGPCS 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build" 6 | }, 7 | "devDependencies": { 8 | "@coreui/coreui": "^4.0.2", 9 | "@popperjs/core": "^2.11.6", 10 | "axios": "^1.1.2", 11 | "bootstrap": "^5.2.3", 12 | "laravel-vite-plugin": "^0.7.2", 13 | "lodash": "^4.17.21", 14 | "resolve-url-loader": "^4.0.0", 15 | "sass": "^1.56.1", 16 | "vite": "^4.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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/bilaschandra/laravel-coreui/e60d843c2c090076f44202e0844440dcd23a066f/public/favicon.ico -------------------------------------------------------------------------------- /public/icons/brand.svg: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /public/img/default-avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilaschandra/laravel-coreui/e60d843c2c090076f44202e0844440dcd23a066f/public/img/default-avatar.jpg -------------------------------------------------------------------------------- /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/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | window._ = _; 3 | 4 | import 'bootstrap'; 5 | 6 | /** 7 | * We'll load the axios HTTP library which allows us to easily issue requests 8 | * to our Laravel back-end. This library automatically handles sending the 9 | * CSRF token as a header based on the value of the "XSRF" token cookie. 10 | */ 11 | 12 | import axios from 'axios'; 13 | window.axios = axios; 14 | 15 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 16 | 17 | /** 18 | * Echo exposes an expressive API for subscribing to channels and listening 19 | * for events that are broadcast by Laravel. Echo and event broadcasting 20 | * allows your team to easily build robust real-time web applications. 21 | */ 22 | 23 | // import Echo from 'laravel-echo'; 24 | 25 | // import Pusher from 'pusher-js'; 26 | // window.Pusher = Pusher; 27 | 28 | // window.Echo = new Echo({ 29 | // broadcaster: 'pusher', 30 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 31 | // wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 32 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 33 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 34 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 35 | // enabledTransports: ['ws', 'wss'], 36 | // }); 37 | -------------------------------------------------------------------------------- /resources/sass/_custom.scss: -------------------------------------------------------------------------------- 1 | // Here you can add other styles 2 | -------------------------------------------------------------------------------- /resources/sass/_layout.scss: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | width: 100%; 3 | @include ltr-rtl("padding-left", var(--cui-sidebar-occupy-start, 0)); 4 | will-change: auto; 5 | @include transition(padding .15s); 6 | } 7 | -------------------------------------------------------------------------------- /resources/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | // Body 2 | $body-bg: #f8fafc; 3 | 4 | // Typography 5 | $font-family-sans-serif: 'Nunito', sans-serif; 6 | $font-size-base: 0.9rem; 7 | $line-height-base: 1.6; 8 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | @import "_variables"; 2 | 3 | @import "coreui/style.scss"; 4 | 5 | @import "_custom"; 6 | @import "_layout"; 7 | -------------------------------------------------------------------------------- /resources/sass/coreui/_custom.scss: -------------------------------------------------------------------------------- 1 | // Here you can add other styles 2 | -------------------------------------------------------------------------------- /resources/sass/coreui/_layout.scss: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | width: 100%; 3 | @include ltr-rtl("padding-left", var(--cui-sidebar-occupy-start, 0)); 4 | will-change: auto; 5 | @include transition(padding .15s); 6 | } 7 | -------------------------------------------------------------------------------- /resources/sass/coreui/examples.scss: -------------------------------------------------------------------------------- 1 | /* stylelint-disable declaration-no-important, scss/selector-no-redundant-nesting-selector */ 2 | @import "@coreui/coreui/scss/functions"; 3 | @import "@coreui/coreui/scss/variables"; 4 | @import "@coreui/coreui/scss/mixins"; 5 | 6 | .example { 7 | &:not(:first-child) { 8 | margin-top: 1.5rem; 9 | } 10 | 11 | .tab-content { 12 | background-color: $light-50 !important; 13 | 14 | @at-root .dark-theme & { 15 | background-color: rgba(255, 255, 255, .1) !important; 16 | } 17 | } 18 | 19 | & + p { 20 | margin-top: 1.5rem; 21 | } 22 | 23 | // Components examples 24 | .preview { 25 | + p { 26 | margin-top: 2rem; 27 | } 28 | 29 | > .form-control { 30 | + .form-control { 31 | margin-top: .5rem; 32 | } 33 | } 34 | 35 | > .nav + .nav, 36 | > .alert + .alert, 37 | > .navbar + .navbar, 38 | > .progress + .progress { 39 | margin-top: 1rem; 40 | } 41 | 42 | > .dropdown-menu { 43 | position: static; 44 | display: block; 45 | } 46 | 47 | > :last-child { 48 | margin-bottom: 0; 49 | } 50 | 51 | // Images 52 | > svg + svg, 53 | > img + img { 54 | margin-left: .5rem; 55 | } 56 | 57 | // Buttons 58 | > .btn, 59 | > .btn-group { 60 | margin: .25rem .125rem; 61 | } 62 | > .btn-toolbar + .btn-toolbar { 63 | margin-top: .5rem; 64 | } 65 | 66 | // List groups 67 | > .list-group { 68 | max-width: 400px; 69 | } 70 | 71 | > [class*="list-group-horizontal"] { 72 | max-width: 100%; 73 | } 74 | 75 | // Navbars 76 | .fixed-top, 77 | .sticky-top { 78 | position: static; 79 | margin: -1rem -1rem 1rem; 80 | } 81 | 82 | .fixed-bottom { 83 | position: static; 84 | margin: 1rem -1rem -1rem; 85 | } 86 | 87 | @include media-breakpoint-up(sm) { 88 | .fixed-top, 89 | .sticky-top { 90 | margin: -1.5rem -1.5rem 1rem; 91 | } 92 | .fixed-bottom { 93 | margin: 1rem -1.5rem -1.5rem; 94 | } 95 | } 96 | 97 | // Pagination 98 | .pagination { 99 | margin-top: .5rem; 100 | margin-bottom: .5rem; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /resources/sass/coreui/style.scss: -------------------------------------------------------------------------------- 1 | // If you want to override variables do it here 2 | @import "variables"; 3 | 4 | $enable-ltr: true; /* stylelint-disable-line scss/dollar-variable-default */ 5 | $enable-rtl: true; /* stylelint-disable-line scss/dollar-variable-default */ 6 | 7 | // Import styles 8 | @import "@coreui/coreui/scss/coreui"; 9 | 10 | @import "layout"; 11 | 12 | // Prism.js 13 | @import "examples"; 14 | 15 | // If you want to add custom CSS you can put it here. 16 | @import "custom"; 17 | -------------------------------------------------------------------------------- /resources/sass/coreui/vendors/simplebar.scss: -------------------------------------------------------------------------------- 1 | .simplebar-content { 2 | display: flex; 3 | flex-direction: column; 4 | min-height: 100%; 5 | } 6 | -------------------------------------------------------------------------------- /resources/views/about.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.guest') 2 | 3 | @section('content') 4 |
5 |
6 | {{ __('About us') }} 7 |
8 |
9 | {{ __('Sample static text page') }} 10 |
11 |
12 | @endsection 13 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.guest') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |

{{ __('Login') }}

9 | 10 | @include('layouts.includes.errors') 11 | 12 |
13 | @csrf 14 |
15 | 16 | 17 | 18 | 20 | @error('username') 21 |
22 | {{ $message }} 23 |
24 | @enderror 25 |
26 |
27 | 28 | 29 | 30 | 33 | @error('password') 34 |
35 | {{ $message }} 36 |
37 | @enderror 38 |
39 |
40 |
41 | 42 |
43 | @if (Route::has('password.request')) 44 | 48 | @endif 49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |

{{ __('Sign up') }}

57 | {{ __('Register') }} 59 |
60 |
61 |
62 |
63 |
64 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/passwords/confirm.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.guest') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

{{ __('Please confirm your password before continuing.') }}

8 | 9 |
10 | @csrf 11 | 12 |
13 | 14 | 15 | 16 | 18 | @error('password') 19 |
20 | {{ $message }} 21 |
22 | @enderror 23 |
24 |
25 |
26 | 27 |
28 | @if (Route::has('password.request')) 29 | 33 | @endif 34 |
35 |
36 | 37 |
38 |
39 |
40 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.guest') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

{{ __('Reset Password') }}

8 |
9 | @csrf 10 | @if(session('status')) 11 | 16 | @endif 17 |
18 | 19 | 20 | 21 | 23 | @error('email') 24 |
25 | {{ $message }} 26 |
27 | @enderror 28 |
29 | 31 |
32 |
33 |
34 |
35 | @endsection 36 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.guest') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

{{ __('Reset Password') }}

8 | 9 |
10 | @csrf 11 | 12 |
13 | 14 | 15 | 16 | 18 | @error('email') 19 |
20 | {{ $message }} 21 |
22 | @enderror 23 |
24 | 25 |
26 | 27 | 28 | 29 | 32 | @error('password') 33 |
34 | {{ $message }} 35 |
36 | @enderror 37 |
38 | 39 |
40 | 41 | 42 | 43 | 46 | @error('password_confirmation') 47 |
48 | {{ $message }} 49 |
50 | @enderror 51 |
52 | 53 | 55 |
56 | 57 |
58 |
59 |
60 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/profile.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | {{ __('My profile') }} 7 |
8 | 9 |
10 | @csrf 11 | @method('PUT') 12 | 13 |
14 | 15 | @if ($message = Session::get('success')) 16 | 17 | @endif 18 | 19 |
20 | 21 | 22 | 23 | 25 | @error('name') 26 | 27 | {{ $message }} 28 | 29 | @enderror 30 |
31 | 32 |
33 | 34 | 35 | 36 | 38 | @error('email') 39 | 40 | {{ $message }} 41 | 42 | @enderror 43 |
44 | 45 |
46 | 47 | 48 | 49 | 51 | @error('password') 52 | 53 | {{ $message }} 54 | 55 | @enderror 56 |
57 | 58 |
59 | 60 | 61 | 62 | 64 |
65 | 66 |
67 | 68 | 71 | 72 |
73 | 74 |
75 | @endsection 76 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.guest') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Register

8 | 9 |
10 | @csrf 11 | 12 |
13 | 14 | 15 | 16 | 18 | @error('first_name') 19 | 20 | {{ $message }} 21 | 22 | @enderror 23 |
24 | 25 |
26 | 27 | 28 | 29 | 31 | @error('last_name') 32 | 33 | {{ $message }} 34 | 35 | @enderror 36 |
37 | 38 |
39 | 40 | 41 | 42 | 44 | @error('email') 45 | 46 | {{ $message }} 47 | 48 | @enderror 49 |
50 | 51 |
52 | 53 | 54 | 55 | 57 | @error('password') 58 | 59 | {{ $message }} 60 | 61 | @enderror 62 |
63 | 64 |
65 | 66 | 67 | 68 | 71 |
72 | 73 | 74 | 75 |
76 |
77 |
78 |
79 | 80 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/verify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.guest') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

{{ __('Please confirm your password before continuing.') }}

8 | 9 | @if (session('resent')) 10 | 13 | @endif 14 | 15 |

{{ __('Before proceeding, please check your email for a verification link.') }}

16 |

{{ __('If you did not receive the email') }},

17 | 18 |
19 | @csrf 20 | 21 |
22 |
23 | 25 |
26 |
27 |
28 | 29 |
30 |
31 |
32 | @endsection -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('breadcrumbs') 4 | 7 | 10 | 11 | @endsection 12 | 13 | @section('content') 14 | @include('dashboard') 15 | @endsection 16 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | @if (trim($__env->yieldContent('title'))) 11 | @yield('title') | {{ config('app.name', 'Laravel') }} 12 | @else 13 | {{ config('app.name', 'Laravel') }} 14 | @endif 15 | 16 | 17 | @stack('before-styles') 18 | @vite('resources/sass/app.scss') 19 | @stack('after-styles') 20 | 21 | 22 | 23 | 35 |
36 | 37 | @include('layouts.includes.header') 38 | 39 | 40 |
41 |
42 | 43 | @include('layouts.includes.errors') 44 | 45 |
@yield('content')
46 |
47 |
48 | 49 | 50 | @include('layouts.includes.footer') 51 | 52 |
53 | 54 | 55 | @stack('before-scripts') 56 | 57 | 58 | 59 | @vite('resources/js/app.js') 60 | 61 | @stack('after-scripts') 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /resources/views/layouts/guest.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('app.name', 'Laravel') }} 9 | 10 | @vite('resources/sass/app.scss') 11 | 12 | 13 | 14 |
15 |
16 |
17 | @yield('content') 18 |
19 |
20 |
21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /resources/views/layouts/includes/errors.blade.php: -------------------------------------------------------------------------------- 1 | @if ($errors->any()) 2 | 11 | @endif -------------------------------------------------------------------------------- /resources/views/layouts/includes/footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | Bilas. 4 | Copyright © {{ date('Y') }} 5 |
6 |
Bootstrap Admin Template
7 |
8 | -------------------------------------------------------------------------------- /resources/views/layouts/includes/header.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 | 16 |
17 | @auth 18 | 47 | @endauth 48 | @if (trim($__env->yieldContent('breadcrumbs'))) 49 |
50 |
51 | 56 |
57 | @endif 58 |
59 |
-------------------------------------------------------------------------------- /resources/views/layouts/includes/messages.blade.php: -------------------------------------------------------------------------------- 1 | @if(Session::get('success', false)) 2 | 3 | @if (is_array($data)) 4 | @foreach ($data as $msg) 5 | 9 | @endforeach 10 | @else 11 | 15 | @endif 16 | @endif -------------------------------------------------------------------------------- /resources/views/layouts/includes/show.blade.php: -------------------------------------------------------------------------------- 1 |

2 | @lang("Displaing all the values of :module_name (Id: :id)", ['module_name'=>ucwords($module_name_singular), 'id'=>$$module_name_singular->id]). 3 |

4 | 5 | getTableColumns(); 7 | ?> 8 | 9 | 10 | 15 | 20 | 21 | 22 | 23 | @foreach ($all_columns as $column) 24 | 25 | 30 | 33 | 34 | @endforeach 35 | 36 |
11 | 12 | @lang('Name') 13 | 14 | 16 | 17 | @lang('Value') 18 | 19 |
26 | 27 | {{ __(label_case($column->Field)) }} 28 | 29 | 31 | {!! show_column_value($$module_name_singular, $column) !!} 32 |
37 | 38 | {{-- Lightbox2 Library --}} 39 | -------------------------------------------------------------------------------- /resources/views/layouts/navigation.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/permissions/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Create Permission 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Create Permission
12 | 13 |
14 | 15 |
16 | @csrf 17 |
18 | 19 | 21 | 22 | @if ($errors->has('name')) 23 | {{ $errors->first('name') }} 24 | @endif 25 |
26 | 27 | 28 | Back 29 |
30 |
31 |
32 |
33 | 34 |
35 | @endsection -------------------------------------------------------------------------------- /resources/views/permissions/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Edit Permission 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Edit Permission
12 | 13 |
14 | 15 |
16 | @method('patch') 17 | @csrf 18 |
19 | 20 | 22 | 23 | @if ($errors->has('name')) 24 | {{ $errors->first('name') }} 25 | @endif 26 |
27 | 28 | 29 | Back 30 |
31 |
32 | 33 |
34 |
35 |
36 | @endsection -------------------------------------------------------------------------------- /resources/views/permissions/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Permission List 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Permissions
12 |
Manage your permissions here.
13 | 14 |
15 | @include('layouts.includes.messages') 16 |
17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach($permissions as $permission) 33 | 34 | 35 | 36 | 38 | 45 | 46 | @endforeach 47 | 48 |
NameGuard
{{ $permission->name }}{{ $permission->guard_name }}Edit 39 |
40 | @csrf 41 | @method('DELETE') 42 | 43 |
44 |
49 | 50 |
51 |
52 |
53 | @endsection 54 | -------------------------------------------------------------------------------- /resources/views/roles/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Create Role 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Add new role
12 |
13 |
14 | 15 |
16 | @csrf 17 |
18 | 19 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach($permissions as $permission) 33 | 34 | 38 | 39 | 40 | 41 | @endforeach 42 |
NameGuard
35 | 37 | {{ $permission->name }}{{ $permission->guard_name }}
43 | 44 | 45 | Back 46 |
47 |
48 | 49 |
50 |
51 |
52 | 53 | @endsection 54 | 55 | @push('after-scripts') 56 | 71 | @endpush -------------------------------------------------------------------------------- /resources/views/roles/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Edit Role 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Update role
12 |
13 | 14 |
15 | @method('patch') 16 | @csrf 17 |
18 | 19 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach($permissions as $permission) 33 | 34 | 40 | 41 | 42 | 43 | @endforeach 44 |
NameGuard
35 | name, $rolePermissions) 37 | ? 'checked' 38 | : '' }}> 39 | {{ $permission->name }}{{ $permission->guard_name }}
45 | 46 | 47 | Back 48 |
49 |
50 | 51 |
52 |
53 |
54 | @endsection 55 | 56 | @push('after-scripts') 57 | 74 | @endpush -------------------------------------------------------------------------------- /resources/views/roles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Role list 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Roles
12 |
Manage your roles here.
13 | 14 |
15 | @include('layouts.includes.messages') 16 |
17 | 18 |
19 | Add role 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @foreach ($roles as $key => $role) 30 | 31 | 32 | 33 | 38 | 41 | 44 | 51 | 52 | @endforeach 53 | 54 |
NoNamePermissionsAction
{{ $role->id }}{{ $role->name }} 34 | @foreach ($role->permissions as $perm) 35 | {{ $perm->name }} 36 | @endforeach 37 | 39 | Show 40 | 42 | Edit 43 | 45 |
46 | @csrf 47 | @method('DELETE') 48 | 49 |
50 |
55 | 56 |
57 | {!! $roles->links() !!} 58 |
59 | 60 |
61 |
62 |
63 | @endsection 64 | -------------------------------------------------------------------------------- /resources/views/roles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Show Role 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
{{ ucfirst($role->name) }} Role
12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | @foreach($rolePermissions as $permission) 21 | 22 | 23 | 24 | 25 | @endforeach 26 |
NameGuard
{{ $permission->name }}{{ $permission->guard_name }}
27 |
28 | Edit 29 | Back 30 |
31 |
32 |
33 |
34 | 35 |
36 | 37 | @endsection -------------------------------------------------------------------------------- /resources/views/settings/fields/checkbox.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | $required = (Str::contains($field['rules'], 'required')) ? "required" : ""; 3 | $required_mark = ($required != "") ? ' * ' : ''; 4 | @endphp 5 | 6 |
7 |
8 | {!! $required_mark !!} 13 | 14 | @if ($errors->has($field['name'])) {{ $errors->first($field['name']) }} @endif 15 |
16 |
-------------------------------------------------------------------------------- /resources/views/settings/fields/email.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | $required = (Str::contains($field['rules'], 'required')) ? "required" : ""; 3 | $required_mark = ($required != "") ? ' * ' : ''; 4 | @endphp 5 | 6 |
7 | {!! $required_mark !!} 8 | 14 | 15 | @if ($errors->has($field['name'])) {{ $errors->first($field['name']) }} @endif 16 |
17 | -------------------------------------------------------------------------------- /resources/views/settings/fields/number.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | $required = (Str::contains($field['rules'], 'required')) ? "required" : ""; 3 | $required_mark = ($required != "") ? ' * ' : ''; 4 | @endphp 5 | 6 |
7 | {!! $required_mark !!} 8 | 14 | 15 | @if ($errors->has($field['name'])) {{ $errors->first($field['name']) }} @endif 16 |
17 | -------------------------------------------------------------------------------- /resources/views/settings/fields/select.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | $required = (Str::contains($field['rules'], 'required')) ? "required" : ""; 3 | $required_mark = ($required != "") ? ' * ' : ''; 4 | @endphp 5 | 6 |
7 | {!! $required_mark !!} 8 | 13 | @if ($errors->has($field['name'])) {{ $errors->first($field['name']) }} @endif 14 |
15 | -------------------------------------------------------------------------------- /resources/views/settings/fields/text.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | $required = (Str::contains($field['rules'], 'required')) ? "required" : ""; 3 | $required_mark = ($required != "") ? ' * ' : ''; 4 | @endphp 5 | 6 |
7 | {!! $required_mark !!} 8 | 14 | 15 | @if ($errors->has($field['name'])) {{ $errors->first($field['name']) }} @endif 16 |
17 | -------------------------------------------------------------------------------- /resources/views/settings/fields/textarea.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | $required = (Str::contains($field['rules'], 'required')) ? "required" : ""; 3 | $required_mark = ($required != "") ? ' * ' : ''; 4 | @endphp 5 | 6 |
7 | {!! $required_mark !!} 8 | 19 | 20 | @if ($errors->has($field['name'])) {{ $errors->first($field['name']) }} @endif 21 | @if(isset($field['help'])){{ $field['help'] }} @endif 22 |
-------------------------------------------------------------------------------- /resources/views/settings/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('backend.layouts.app') 2 | 3 | @section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection 4 | 5 | @section('breadcrumbs') 6 | 7 | {{ __($module_title) }} 8 | 9 | @endsection 10 | 11 | @section('content') 12 |
13 |
14 | 15 | 16 | {{ __($module_title) }} {{ __($module_action) }} 17 | 18 | 19 | @lang(":module_name Management Dashboard", ['module_name'=>Str::title($module_name)]) 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 |
29 |
30 |
31 | {!! csrf_field() !!} 32 | 33 | @if(count(config('setting_fields', [])) ) 34 | 35 | @foreach(config('setting_fields') as $section => $fields) 36 |
37 |
38 | 39 | {{ $fields['title'] }} 40 |
41 |
42 |

{{ $fields['desc'] }}

43 | 44 |
45 |
46 | @foreach($fields['elements'] as $field) 47 | @includeIf('backend.settings.fields.' . $field['type'] ) 48 | @endforeach 49 |
50 |
51 |
52 |
53 | @endforeach 54 | 55 | @endif 56 | 57 |
58 |
59 | 62 |
63 |
64 | 65 |
66 |
67 |
68 |
69 | 74 |
75 | @endsection -------------------------------------------------------------------------------- /resources/views/users/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Create User 5 | @endsection 6 | 7 | @section('content') 8 |
9 |

Add new user

10 |
11 | Add new user and assign role. 12 |
13 | 14 |
15 |
16 | @csrf 17 |
18 | 19 | 24 | 25 | @if ($errors->has('name')) 26 | {{ $errors->first('name') }} 27 | @endif 28 |
29 |
30 | 31 | 36 | @if ($errors->has('email')) 37 | {{ $errors->first('email') }} 38 | @endif 39 |
40 |
41 | 42 | 47 | @if ($errors->has('username')) 48 | {{ $errors->first('username') }} 49 | @endif 50 |
51 | 52 | 53 | Back 54 |
55 |
56 | 57 |
58 | @endsection -------------------------------------------------------------------------------- /resources/views/users/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Edit User 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Update user
12 | 13 |
14 |
15 | @method('patch') 16 | @csrf 17 |
18 | 19 | 21 | 22 | @if ($errors->has('name')) 23 | {{ $errors->first('name') }} 24 | @endif 25 |
26 |
27 | 28 | 30 | @if ($errors->has('email')) 31 | {{ $errors->first('email') }} 32 | @endif 33 |
34 |
35 | 36 | 38 | @if ($errors->has('username')) 39 | {{ $errors->first('username') }} 40 | @endif 41 |
42 |
43 | 44 | 52 | @if ($errors->has('role')) 53 | {{ $errors->first('role') }} 54 | @endif 55 |
56 | 57 | 58 | Cancel 59 |
60 |
61 |
62 |
63 | 64 |
65 | @endsection 66 | -------------------------------------------------------------------------------- /resources/views/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | User List 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Users
12 |
Manage your users here.
13 | 14 |
15 | @include('layouts.includes.messages') 16 |
17 | 18 |
19 | Add user 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | @foreach($users as $user) 35 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 47 | 54 | 55 | @endforeach 56 | 57 |
#NameEmailUsernameRoles
{{ $user->id }}{{ $user->name }}{{ $user->email }}{{ $user->username }} 41 | @foreach($user->roles as $role) 42 | {{ $role->name }} 43 | @endforeach 44 | ShowEdit 48 |
49 | @csrf 50 | @method('DELETE') 51 | 52 |
53 |
58 | 59 |
60 | {!! $users->links() !!} 61 |
62 | 63 |
64 |
65 |
66 | @endsection 67 | -------------------------------------------------------------------------------- /resources/views/users/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title') 4 | Show User 5 | @endsection 6 | 7 | @section('content') 8 |
9 |
10 |
11 |
Show user
12 | 13 |
14 |
15 | Name: {{ $user->name }} 16 |
17 |
18 | Email: {{ $user->email }} 19 |
20 |
21 | Username: {{ $user->username }} 22 |
23 | 24 |
25 | Edit 26 | Back 27 |
28 |
29 | 30 |
31 | 32 |
33 |
34 | @endsection -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | false]); 29 | 30 | 31 | Route::group(['namespace' => 'App\Http\Controllers'], function() 32 | { 33 | Route::middleware('auth')->group(function () { 34 | /** 35 | * Home Routes 36 | */ 37 | Route::get('/dashboard', [App\Http\Controllers\HomeController::class, 'index'])->name('dashboard'); 38 | /** 39 | * Role Routes 40 | */ 41 | Route::resource('roles', RolesController::class); 42 | /** 43 | * Permission Routes 44 | */ 45 | Route::resource('permissions', PermissionsController::class); 46 | /** 47 | * User Routes 48 | */ 49 | Route::group(['prefix' => 'users'], function() { 50 | Route::get('/', [App\Http\Controllers\UsersController::class, 'index'])->name('users.index'); 51 | Route::get('/create', 'UsersController@create')->name('users.create'); 52 | Route::post('/create', 'UsersController@store')->name('users.store'); 53 | Route::get('/{user}/show', 'UsersController@show')->name('users.show'); 54 | Route::get('/{user}/edit', 'UsersController@edit')->name('users.edit'); 55 | Route::patch('/{user}/update', 'UsersController@update')->name('users.update'); 56 | Route::delete('/{user}/delete', 'UsersController@destroy')->name('users.destroy'); 57 | }); 58 | }); 59 | }); 60 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/debugbar/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.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 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | import path from 'path'; 4 | 5 | export default defineConfig({ 6 | server: { 7 | port: 5173, 8 | }, 9 | plugins: [ 10 | laravel({ 11 | input: [ 12 | 'resources/sass/app.scss', 13 | 'resources/js/app.js', 14 | ], 15 | refresh: true, 16 | }), 17 | ], 18 | resolve: { 19 | alias: { 20 | '~coreui': path.resolve(__dirname, 'node_modules/@coreui/coreui'), 21 | } 22 | }, 23 | }); 24 | --------------------------------------------------------------------------------