├── .devcontainer └── devcontainer.json ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .prettierrc.cjs ├── LICENSE ├── README.md ├── app ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── AuthenticatedSessionController.php │ │ │ ├── ConfirmablePasswordController.php │ │ │ ├── EmailVerificationNotificationController.php │ │ │ ├── EmailVerificationPromptController.php │ │ │ ├── NewPasswordController.php │ │ │ ├── PasswordResetLinkController.php │ │ │ ├── RegisteredUserController.php │ │ │ └── VerifyEmailController.php │ │ ├── Controller.php │ │ └── Settings │ │ │ ├── PasswordController.php │ │ │ └── ProfileController.php │ ├── Middleware │ │ ├── EncryptCookies.php │ │ └── HandleInertiaRequests.php │ └── Requests │ │ ├── Auth │ │ └── LoginRequest.php │ │ └── ProfileUpdateRequest.php ├── Models │ └── User.php ├── Providers │ └── AppServiceProvider.php └── helpers.php ├── artisan ├── bootstrap ├── app.php ├── cache │ └── .gitignore └── providers.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── database.php ├── filesystems.php ├── logging.php ├── mail.php ├── queue.php ├── services.php └── session.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 0001_01_01_000000_create_users_table.php │ ├── 0001_01_01_000001_create_cache_table.php │ └── 0001_01_01_000002_create_jobs_table.php └── seeders │ └── DatabaseSeeder.php ├── docker-compose.local.yml ├── docker └── local │ ├── database │ ├── mysql │ │ └── create-testing-database.sh │ └── pgsql │ │ └── create-testing-database.sql │ └── web │ ├── Dockerfile │ ├── php.ini │ ├── start-container │ └── supervisord.conf ├── eslint.config.js ├── package-lock.json ├── package.json ├── phpstan.neon ├── phpunit.xml ├── pint.json ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── resources ├── css │ ├── app.css │ ├── custom-preflight.css │ └── tailwind.css ├── js │ ├── app.js │ ├── components │ │ ├── ApplicationLogo.vue │ │ ├── ClientOnly.vue │ │ ├── Container.vue │ │ ├── DeleteUserModal.vue │ │ ├── FlashMessages.vue │ │ ├── NavLogoLink.vue │ │ ├── PageTitleSection.vue │ │ ├── SelectColorModeButton.vue │ │ ├── ThemePresetSelector.vue │ │ └── primevue │ │ │ └── menu │ │ │ ├── Breadcrumb.vue │ │ │ ├── ContextMenu.vue │ │ │ ├── Menu.vue │ │ │ ├── Menubar.vue │ │ │ ├── PanelMenu.vue │ │ │ ├── TabMenu.vue │ │ │ └── TieredMenu.vue │ ├── composables │ │ ├── useAppLayout.ts │ │ ├── useLazyDataTable.ts │ │ ├── usePaginatedData.ts │ │ ├── useSiteColorMode.ts │ │ └── useThemePreset.ts │ ├── layouts │ │ ├── AppLayout.vue │ │ ├── GuestAuthLayout.vue │ │ ├── UserSettingsLayout.vue │ │ └── app │ │ │ ├── HeaderLayout.vue │ │ │ └── SidebarLayout.vue │ ├── pages │ │ ├── Dashboard.vue │ │ ├── Error.vue │ │ ├── Welcome.vue │ │ ├── auth │ │ │ ├── ConfirmPassword.vue │ │ │ ├── ForgotPassword.vue │ │ │ ├── Login.vue │ │ │ ├── Register.vue │ │ │ ├── ResetPassword.vue │ │ │ └── VerifyEmail.vue │ │ └── settings │ │ │ ├── Appearance.vue │ │ │ ├── Password.vue │ │ │ └── Profile.vue │ ├── ssr.js │ ├── theme │ │ ├── bootstrap-preset.js │ │ ├── breeze-preset.js │ │ ├── enterprise-preset.js │ │ ├── noir-preset.js │ │ └── warm-preset.js │ ├── types │ │ ├── global.d.ts │ │ ├── index.d.ts │ │ └── paginiation.d.ts │ └── utils.ts └── views │ └── app.blade.php ├── routes ├── auth.php ├── console.php ├── settings.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── logs │ └── .gitignore └── pail │ └── .gitignore ├── tests ├── Feature │ ├── Auth │ │ ├── AuthenticationTest.php │ │ ├── EmailVerificationTest.php │ │ ├── PasswordConfirmationTest.php │ │ ├── PasswordResetTest.php │ │ └── RegistrationTest.php │ ├── ExampleTest.php │ └── Settings │ │ ├── PasswordUpdateTest.php │ │ └── ProfileUpdateTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── tsconfig.json └── vite.config.js /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // https://aka.ms/devcontainer.json 2 | { 3 | "name": "PrimeVue Inertia", 4 | "dockerComposeFile": [ 5 | "../docker-compose.local.yml" 6 | ], 7 | "service": "laravel", 8 | "workspaceFolder": "/var/www/html", 9 | "mounts": [ 10 | "type=bind,source=/home/${localEnv:USER}/.ssh,target=/home/sail/.ssh,readonly" 11 | ], 12 | "customizations": { 13 | "vscode": { 14 | "extensions": [ 15 | "DEVSENSE.phptools-vscode", 16 | "MehediDracula.php-namespace-resolver", 17 | "laravel.vscode-laravel", 18 | "Vue.volar", 19 | "hollowtree.vue-snippets", 20 | "bradlc.vscode-tailwindcss", 21 | "eamodio.gitlens", 22 | "esbenp.prettier-vscode", 23 | "mikestead.dotenv", 24 | "streetsidesoftware.code-spell-checker", 25 | "shd101wyy.markdown-preview-enhanced", 26 | "formulahendry.auto-rename-tag", 27 | "pmneo.tsimporter" 28 | ], 29 | "settings": { 30 | "html.format.wrapAttributes": "force-expand-multiline", 31 | "[vue]": { 32 | "editor.defaultFormatter": "Vue.volar", 33 | "editor.tabSize": 4 34 | } 35 | } 36 | } 37 | }, 38 | "remoteUser": "sail", 39 | "postCreateCommand": "chown -R 1000:1000 /var/www/html 2>/dev/null || true" 40 | // "forwardPorts": [], 41 | // "runServices": [], 42 | // "shutdownAction": "none", 43 | } -------------------------------------------------------------------------------- /.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 + PrimeVue" 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_TIMEZONE=UTC 6 | APP_URL=http://localhost:8000 7 | 8 | APP_LOCALE=en 9 | APP_FALLBACK_LOCALE=en 10 | APP_FAKER_LOCALE=en_US 11 | 12 | APP_MAINTENANCE_DRIVER=file 13 | APP_MAINTENANCE_STORE=database 14 | 15 | BCRYPT_ROUNDS=12 16 | 17 | LOG_CHANNEL=stack 18 | LOG_STACK=single 19 | LOG_DEPRECATIONS_CHANNEL=null 20 | LOG_LEVEL=debug 21 | 22 | DB_CONNECTION=sqlite 23 | #DB_HOST= 24 | #DB_PORT= 25 | #DB_DATABASE= 26 | #DB_USERNAME= 27 | #DB_PASSWORD= 28 | 29 | SESSION_DRIVER=file 30 | SESSION_LIFETIME=120 31 | SESSION_ENCRYPT=false 32 | SESSION_PATH=/ 33 | SESSION_DOMAIN=null 34 | 35 | BROADCAST_CONNECTION=log 36 | FILESYSTEM_DISK=local 37 | QUEUE_CONNECTION=sync 38 | 39 | CACHE_STORE=file 40 | CACHE_PREFIX= 41 | 42 | MEMCACHED_HOST=127.0.0.1 43 | 44 | REDIS_CLIENT=phpredis 45 | REDIS_HOST=127.0.0.1 46 | REDIS_PASSWORD=null 47 | REDIS_PORT=6379 48 | 49 | MAIL_MAILER=log 50 | MAIL_HOST=127.0.0.1 51 | MAIL_PORT=2525 52 | MAIL_USERNAME=null 53 | MAIL_PASSWORD=null 54 | MAIL_ENCRYPTION=null 55 | MAIL_FROM_ADDRESS="hello@example.com" 56 | MAIL_FROM_NAME="${APP_NAME}" 57 | 58 | AWS_ACCESS_KEY_ID= 59 | AWS_SECRET_ACCESS_KEY= 60 | AWS_DEFAULT_REGION=us-east-1 61 | AWS_BUCKET= 62 | AWS_USE_PATH_STYLE_ENDPOINT=false 63 | 64 | VITE_APP_NAME="${APP_NAME}" 65 | 66 | WWWGROUP=1000 67 | WWWUSER=1000 68 | 69 | APP_PORT=8000 70 | VITE_PORT=5173 71 | FORWARD_DB_PORT= 72 | -------------------------------------------------------------------------------- /.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 | /bootstrap/ssr 4 | /public/build 5 | /public/hot 6 | /public/storage 7 | /public/themes 8 | /storage/*.key 9 | /vendor 10 | .env 11 | .env.backup 12 | .env.production 13 | .phpactor.json 14 | .phpunit.result.cache 15 | Homestead.json 16 | Homestead.yaml 17 | auth.json 18 | npm-debug.log 19 | yarn-error.log 20 | components.d.ts 21 | /.fleet 22 | /.idea 23 | /.vscode -------------------------------------------------------------------------------- /.prettierrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | }; 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Connor Abbas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel + PrimeVue Starter Kit 2 | 3 | ## About 4 | 5 | ![Static Badge](https://img.shields.io/badge/Laravel%20-%20v12%20-%20%23f9322c) ![Static Badge](https://img.shields.io/badge/Inertia.js%20-%20v2%20-%20%236b46c1) ![Static Badge]() ![Static Badge]() ![Static Badge](https://img.shields.io/badge/Tailwind%20CSS%20-%20v4%20-%20%230284c7) 6 | 7 | A basic authentication starter kit using [Laravel](https://laravel.com/docs/master), [Intertia.js](https://inertiajs.com/), [PrimeVue](https://primevue.org/) components, and [Tailwind CSS](https://tailwindcss.com/). 8 | 9 | > [!TIP] 10 | > Do you need a separate Vue SPA front-end instead of using Inertia.js? Consider using the [PrimeVue SPA + Laravel API Starter Kit](https://github.com/connorabbas/laravel-api-primevue-starter-kit) instead. 11 | 12 | ## Resources 13 | 14 | [🌐 **Demo Application**](https://laravel-primevue-starter-kit-demo.laravel.cloud/) 15 | 16 | [📚 **Documentation**](https://connorabbas.github.io/laravel-primevue-starter-kit-docs/) 17 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthenticatedSessionController.php: -------------------------------------------------------------------------------- 1 | Route::has('password.request'), 23 | 'status' => session('status'), 24 | ]); 25 | } 26 | 27 | /** 28 | * Handle an incoming authentication request. 29 | */ 30 | public function store(LoginRequest $request): RedirectResponse 31 | { 32 | $request->authenticate(); 33 | 34 | $request->session()->regenerate(); 35 | 36 | return redirect()->intended(route('dashboard', absolute: false)); 37 | } 38 | 39 | /** 40 | * Destroy an authenticated session. 41 | */ 42 | public function destroy(Request $request): RedirectResponse 43 | { 44 | Auth::guard('web')->logout(); 45 | 46 | $request->session()->invalidate(); 47 | 48 | $request->session()->regenerateToken(); 49 | 50 | return redirect('/'); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ConfirmablePasswordController.php: -------------------------------------------------------------------------------- 1 | validate([ 29 | 'email' => $request->user()?->email, 30 | 'password' => $request->password, 31 | ]); 32 | 33 | if (!$successfullyValidated) { 34 | throw ValidationException::withMessages([ 35 | 'password' => __('auth.password'), 36 | ]); 37 | } 38 | 39 | $request->session()->put('auth.password_confirmed_at', time()); 40 | 41 | return redirect()->intended(route('dashboard', absolute: false)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationNotificationController.php: -------------------------------------------------------------------------------- 1 | user(); 17 | 18 | if ($user?->hasVerifiedEmail()) { 19 | return redirect()->intended(route('dashboard', absolute: false)); 20 | } 21 | 22 | $user?->sendEmailVerificationNotification(); 23 | 24 | return back()->with('status', 'verification-link-sent'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationPromptController.php: -------------------------------------------------------------------------------- 1 | user()?->hasVerifiedEmail() 19 | ? redirect()->intended(route('dashboard', absolute: false)) 20 | : Inertia::render('auth/VerifyEmail', ['status' => session('status')]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/NewPasswordController.php: -------------------------------------------------------------------------------- 1 | $request->email, 26 | 'token' => $request->route('token'), 27 | ]); 28 | } 29 | 30 | /** 31 | * Handle an incoming new password request. 32 | * 33 | * @throws ValidationException 34 | */ 35 | public function store(Request $request): RedirectResponse 36 | { 37 | $request->validate([ 38 | 'token' => ['required', 'string'], 39 | 'email' => ['required', 'email'], 40 | 'password' => ['required', 'string', 'confirmed', Rules\Password::defaults()], 41 | ]); 42 | 43 | // Here we will attempt to reset the user's password. If it is successful we 44 | // will update the password on an actual user model and persist it to the 45 | // database. Otherwise we will parse the error and return the response. 46 | /** @var string $status */ 47 | $status = Password::reset( 48 | $request->only('email', 'password', 'password_confirmation', 'token'), 49 | function ($user) use ($request) { 50 | $user->forceFill([ 51 | 'password' => Hash::make($request->string('password')), 52 | 'remember_token' => Str::random(60), 53 | ])->save(); 54 | 55 | event(new PasswordReset($user)); 56 | } 57 | ); 58 | 59 | // If the password was successfully reset, we will redirect the user back to 60 | // the application's home authenticated view. If there is an error we can 61 | // redirect them back to where they came from with their error message. 62 | if ($status == Password::PASSWORD_RESET) { 63 | return redirect()->route('login')->with('status', __($status)); 64 | } 65 | 66 | throw ValidationException::withMessages([ 67 | 'email' => [__($status)], 68 | ]); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordResetLinkController.php: -------------------------------------------------------------------------------- 1 | session('status'), 22 | ]); 23 | } 24 | 25 | /** 26 | * Handle an incoming password reset link request. 27 | * 28 | * @throws ValidationException 29 | */ 30 | public function store(Request $request): RedirectResponse 31 | { 32 | $request->validate([ 33 | 'email' => ['required', 'email'], 34 | ]); 35 | 36 | // We will send the password reset link to this user. Once we have attempted 37 | // to send the link, we will examine the response then see the message we 38 | // need to show to the user. Finally, we'll send out a proper response. 39 | $status = Password::sendResetLink( 40 | $request->only('email') 41 | ); 42 | 43 | if ($status == Password::RESET_LINK_SENT) { 44 | return back()->with('status', __($status)); 45 | } 46 | 47 | throw ValidationException::withMessages([ 48 | 'email' => [__($status)], 49 | ]); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisteredUserController.php: -------------------------------------------------------------------------------- 1 | validate([ 34 | 'name' => ['required', 'string', 'max:255'], 35 | 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:' . User::class], 36 | 'password' => ['required', 'string', 'confirmed', Rules\Password::defaults()], 37 | ]); 38 | 39 | $user = User::create([ 40 | 'name' => $request->name, 41 | 'email' => $request->email, 42 | 'password' => Hash::make($request->string('password')), 43 | ]); 44 | 45 | event(new Registered($user)); 46 | 47 | Auth::login($user); 48 | 49 | return redirect(route('dashboard', absolute: false)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerifyEmailController.php: -------------------------------------------------------------------------------- 1 | user(); 19 | 20 | if ($user && $user->hasVerifiedEmail()) { 21 | return redirect()->intended(route('dashboard', absolute: false) . '?verified=1'); 22 | } 23 | 24 | if ($user instanceof MustVerifyEmail && $user->markEmailAsVerified()) { 25 | event(new Verified($user)); 26 | } 27 | 28 | return redirect()->intended(route('dashboard', absolute: false) . '?verified=1'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | $request->user() instanceof MustVerifyEmail, 23 | 'status' => $request->session()->get('status'), 24 | ]); 25 | } 26 | 27 | /** 28 | * Update the user's password. 29 | */ 30 | public function update(Request $request): RedirectResponse 31 | { 32 | $validated = $request->validate([ 33 | 'current_password' => ['required', 'current_password'], 34 | 'password' => ['required', Password::defaults(), 'confirmed'], 35 | ]); 36 | 37 | $request->user()?->update([ 38 | 'password' => Hash::make($validated['password']), 39 | ]); 40 | 41 | return back(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Controllers/Settings/ProfileController.php: -------------------------------------------------------------------------------- 1 | $request->user() instanceof MustVerifyEmail, 23 | 'status' => session('status'), 24 | ]); 25 | } 26 | 27 | /** 28 | * Update the user's profile information. 29 | */ 30 | public function update(ProfileUpdateRequest $request): RedirectResponse 31 | { 32 | $user = $request->user(); 33 | 34 | $user?->fill($request->validated()); 35 | 36 | if ($user && $user->isDirty('email')) { 37 | $user->email_verified_at = null; 38 | } 39 | 40 | $user?->save(); 41 | 42 | return redirect()->route('profile.edit'); 43 | } 44 | 45 | /** 46 | * Delete the user's profile. 47 | */ 48 | public function destroy(Request $request): RedirectResponse 49 | { 50 | $request->validate([ 51 | 'password' => ['required', 'current_password'], 52 | ]); 53 | 54 | $user = $request->user(); 55 | 56 | Auth::logout(); 57 | 58 | $user?->delete(); 59 | 60 | $request->session()->invalidate(); 61 | $request->session()->regenerateToken(); 62 | 63 | return redirect()->route('welcome'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'colorScheme' 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/HandleInertiaRequests.php: -------------------------------------------------------------------------------- 1 | 36 | */ 37 | public function share(Request $request): array 38 | { 39 | return [ 40 | ...parent::share($request), 41 | 'colorScheme' => fn () => $request->cookie('colorScheme', 'auto'), 42 | 'ziggy' => fn () => [ 43 | ...(new Ziggy())->toArray(), 44 | 'location' => $request->url(), 45 | ], 46 | 'auth' => [ 47 | 'user' => $request->user(), 48 | ], 49 | 'flash' => [ 50 | 'success' => fn () => $request->session()->get('flash_success'), 51 | 'info' => fn () => $request->session()->get('flash_info'), 52 | 'warn' => fn () => $request->session()->get('flash_warn'), 53 | 'error' => fn () => $request->session()->get('flash_error'), 54 | 'message' => fn () => $request->session()->get('flash_message'), 55 | ], 56 | ]; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Http/Requests/Auth/LoginRequest.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | public function rules(): array 28 | { 29 | return [ 30 | 'email' => ['required', 'string', 'email'], 31 | 'password' => ['required', 'string'], 32 | ]; 33 | } 34 | 35 | /** 36 | * Attempt to authenticate the request's credentials. 37 | * 38 | * @throws ValidationException 39 | */ 40 | public function authenticate(): void 41 | { 42 | $this->ensureIsNotRateLimited(); 43 | 44 | if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { 45 | RateLimiter::hit($this->throttleKey()); 46 | 47 | throw ValidationException::withMessages([ 48 | 'email' => __('auth.failed'), 49 | ]); 50 | } 51 | 52 | RateLimiter::clear($this->throttleKey()); 53 | } 54 | 55 | /** 56 | * Ensure the login request is not rate limited. 57 | * 58 | * @throws ValidationException 59 | */ 60 | public function ensureIsNotRateLimited(): void 61 | { 62 | if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { 63 | return; 64 | } 65 | 66 | event(new Lockout($this)); 67 | 68 | $seconds = RateLimiter::availableIn($this->throttleKey()); 69 | 70 | throw ValidationException::withMessages([ 71 | 'email' => __('auth.throttle', [ 72 | 'seconds' => $seconds, 73 | 'minutes' => ceil($seconds / 60), 74 | ]), 75 | ]); 76 | } 77 | 78 | /** 79 | * Get the rate limiting throttle key for the request. 80 | */ 81 | public function throttleKey(): string 82 | { 83 | return Str::transliterate(Str::lower($this->string('email')) . '|' . $this->ip()); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/Http/Requests/ProfileUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | public function rules(): array 17 | { 18 | return [ 19 | 'name' => ['required', 'string', 'max:255'], 20 | 'email' => [ 21 | 'required', 22 | 'string', 23 | 'lowercase', 24 | 'email', 25 | 'max:255', 26 | Rule::unique(User::class)->ignore($this->user()?->id) 27 | ], 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | */ 13 | use HasFactory; 14 | use Notifiable; 15 | 16 | /** 17 | * The attributes that are mass assignable. 18 | * 19 | * @var list 20 | */ 21 | protected $fillable = [ 22 | 'name', 23 | 'email', 24 | 'password', 25 | ]; 26 | 27 | /** 28 | * The attributes that should be hidden for serialization. 29 | * 30 | * @var list 31 | */ 32 | protected $hidden = [ 33 | 'password', 34 | 'remember_token', 35 | ]; 36 | 37 | /** 38 | * Get the attributes that should be cast. 39 | * 40 | * @return array 41 | */ 42 | protected function casts(): array 43 | { 44 | return [ 45 | 'email_verified_at' => 'datetime', 46 | 'password' => 'hashed', 47 | ]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 16 | web: __DIR__ . '/../routes/web.php', 17 | commands: __DIR__ . '/../routes/console.php', 18 | health: '/up', 19 | ) 20 | ->withMiddleware(function (Middleware $middleware) { 21 | $middleware->web( 22 | append: [ 23 | HandleInertiaRequests::class, 24 | AddLinkHeadersForPreloadedAssets::class, 25 | ], 26 | replace: [ 27 | BaseEncryptCookies::class => EncryptCookies::class 28 | ], 29 | ); 30 | }) 31 | ->withExceptions(function (Exceptions $exceptions) { 32 | $exceptions->respond(function (Response $response, Throwable $exception, Request $request) { 33 | if ( 34 | !app()->environment(['local', 'testing']) 35 | && in_array($response->getStatusCode(), [500, 503, 404, 403]) 36 | ) { 37 | return Inertia::render('Error', [ 38 | 'homepageRoute' => route('welcome'), 39 | 'status' => $response->getStatusCode() 40 | ]) 41 | ->toResponse($request) 42 | ->setStatusCode($response->getStatusCode()); 43 | } elseif ($response->getStatusCode() === 419) { 44 | return back()->with([ 45 | 'flash_message' => 'The page expired, please try again.', 46 | ]); 47 | } 48 | 49 | return $response; 50 | }); 51 | })->create(); 52 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services the application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => (bool) env('APP_DEBUG', false), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | the application so that it's available within Artisan commands. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://localhost'), 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Timezone 60 | |-------------------------------------------------------------------------- 61 | | 62 | | Here you may specify the default timezone for your application, which 63 | | will be used by the PHP date and date-time functions. The timezone 64 | | is set to "UTC" by default as it is suitable for most use cases. 65 | | 66 | */ 67 | 68 | 'timezone' => env('APP_TIMEZONE', 'UTC'), 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Application Locale Configuration 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The application locale determines the default locale that will be used 76 | | by Laravel's translation / localization methods. This option can be 77 | | set to any locale for which you plan to have translation strings. 78 | | 79 | */ 80 | 81 | 'locale' => env('APP_LOCALE', 'en'), 82 | 83 | 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), 84 | 85 | 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Encryption Key 90 | |-------------------------------------------------------------------------- 91 | | 92 | | This key is utilized by Laravel's encryption services and should be set 93 | | to a random, 32 character string to ensure that all encrypted values 94 | | are secure. You should do this prior to deploying the application. 95 | | 96 | */ 97 | 98 | 'cipher' => 'AES-256-CBC', 99 | 100 | 'key' => env('APP_KEY'), 101 | 102 | 'previous_keys' => [ 103 | ...array_filter( 104 | explode(',', env('APP_PREVIOUS_KEYS', '')) 105 | ), 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Maintenance Mode Driver 111 | |-------------------------------------------------------------------------- 112 | | 113 | | These configuration options determine the driver used to determine and 114 | | manage Laravel's "maintenance mode" status. The "cache" driver will 115 | | allow maintenance mode to be controlled across multiple machines. 116 | | 117 | | Supported drivers: "file", "cache" 118 | | 119 | */ 120 | 121 | 'maintenance' => [ 122 | 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), 123 | 'store' => env('APP_MAINTENANCE_STORE', 'database'), 124 | ], 125 | 126 | ]; 127 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => env('AUTH_GUARD', 'web'), 18 | 'passwords' => env('AUTH_PASSWORD_BROKER', '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 | | which utilizes session storage plus the Eloquent user provider. 29 | | 30 | | All authentication guards have a user provider, which defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | system used by the application. Typically, Eloquent is utilized. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication guards have a user provider, which defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | system used by the application. Typically, Eloquent is utilized. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | providers to represent the model / table. These providers may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => env('AUTH_MODEL', App\Models\User::class), 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | These configuration options specify the behavior of Laravel's password 80 | | reset functionality, including the table utilized for token storage 81 | | and the user provider that is invoked to actually retrieve users. 82 | | 83 | | The expiry time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | | The throttle setting is the number of seconds a user must wait before 88 | | generating more password reset tokens. This prevents the user from 89 | | quickly generating a very large amount of password reset tokens. 90 | | 91 | */ 92 | 93 | 'passwords' => [ 94 | 'users' => [ 95 | 'provider' => 'users', 96 | 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), 97 | 'expire' => 60, 98 | 'throttle' => 60, 99 | ], 100 | ], 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Password Confirmation Timeout 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Here you may define the amount of seconds before a password confirmation 108 | | window expires and users are asked to re-enter their password via the 109 | | confirmation screen. By default, the timeout lasts for three hours. 110 | | 111 | */ 112 | 113 | 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_STORE', 'database'), 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: "array", "database", "file", "memcached", 30 | | "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'array' => [ 37 | 'driver' => 'array', 38 | 'serialize' => false, 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => env('DB_CACHE_TABLE', 'cache'), 44 | 'connection' => env('DB_CACHE_CONNECTION'), 45 | 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), 46 | ], 47 | 48 | 'file' => [ 49 | 'driver' => 'file', 50 | 'path' => storage_path('framework/cache/data'), 51 | 'lock_path' => storage_path('framework/cache/data'), 52 | ], 53 | 54 | 'memcached' => [ 55 | 'driver' => 'memcached', 56 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 57 | 'sasl' => [ 58 | env('MEMCACHED_USERNAME'), 59 | env('MEMCACHED_PASSWORD'), 60 | ], 61 | 'options' => [ 62 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 63 | ], 64 | 'servers' => [ 65 | [ 66 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 67 | 'port' => env('MEMCACHED_PORT', 11211), 68 | 'weight' => 100, 69 | ], 70 | ], 71 | ], 72 | 73 | 'redis' => [ 74 | 'driver' => 'redis', 75 | 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), 76 | 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), 77 | ], 78 | 79 | 'dynamodb' => [ 80 | 'driver' => 'dynamodb', 81 | 'key' => env('AWS_ACCESS_KEY_ID'), 82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 85 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 86 | ], 87 | 88 | 'octane' => [ 89 | 'driver' => 'octane', 90 | ], 91 | 92 | ], 93 | 94 | /* 95 | |-------------------------------------------------------------------------- 96 | | Cache Key Prefix 97 | |-------------------------------------------------------------------------- 98 | | 99 | | When utilizing the APC, database, memcached, Redis, and DynamoDB cache 100 | | stores, there might be other applications using the same cache. For 101 | | that reason, you may prefix every cache key to avoid collisions. 102 | | 103 | */ 104 | 105 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), 106 | 107 | ]; 108 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Below you may configure as many filesystem disks as necessary, and you 24 | | may even configure multiple disks for the same driver. Examples for 25 | | most supported storage drivers are configured here for reference. 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/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Deprecations Log Channel 26 | |-------------------------------------------------------------------------- 27 | | 28 | | This option controls the log channel that should be used to log warnings 29 | | regarding deprecated PHP and library features. This allows you to get 30 | | your application ready for upcoming major versions of dependencies. 31 | | 32 | */ 33 | 34 | 'deprecations' => [ 35 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 36 | 'trace' => env('LOG_DEPRECATIONS_TRACE', false), 37 | ], 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Log Channels 42 | |-------------------------------------------------------------------------- 43 | | 44 | | Here you may configure the log channels for your application. Laravel 45 | | utilizes the Monolog PHP logging library, which includes a variety 46 | | of powerful log handlers and formatters that you're free to use. 47 | | 48 | | Available drivers: "single", "daily", "slack", "syslog", 49 | | "errorlog", "monolog", "custom", "stack" 50 | | 51 | */ 52 | 53 | 'channels' => [ 54 | 55 | 'stack' => [ 56 | 'driver' => 'stack', 57 | 'channels' => explode(',', env('LOG_STACK', 'single')), 58 | 'ignore_exceptions' => false, 59 | ], 60 | 61 | 'single' => [ 62 | 'driver' => 'single', 63 | 'path' => storage_path('logs/laravel.log'), 64 | 'level' => env('LOG_LEVEL', 'debug'), 65 | 'replace_placeholders' => true, 66 | ], 67 | 68 | 'daily' => [ 69 | 'driver' => 'daily', 70 | 'path' => storage_path('logs/laravel.log'), 71 | 'level' => env('LOG_LEVEL', 'debug'), 72 | 'days' => env('LOG_DAILY_DAYS', 14), 73 | 'replace_placeholders' => true, 74 | ], 75 | 76 | 'slack' => [ 77 | 'driver' => 'slack', 78 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 79 | 'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'), 80 | 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), 81 | 'level' => env('LOG_LEVEL', 'critical'), 82 | 'replace_placeholders' => true, 83 | ], 84 | 85 | 'papertrail' => [ 86 | 'driver' => 'monolog', 87 | 'level' => env('LOG_LEVEL', 'debug'), 88 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 89 | 'handler_with' => [ 90 | 'host' => env('PAPERTRAIL_URL'), 91 | 'port' => env('PAPERTRAIL_PORT'), 92 | 'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'), 93 | ], 94 | 'processors' => [PsrLogMessageProcessor::class], 95 | ], 96 | 97 | 'stderr' => [ 98 | 'driver' => 'monolog', 99 | 'level' => env('LOG_LEVEL', 'debug'), 100 | 'handler' => StreamHandler::class, 101 | 'formatter' => env('LOG_STDERR_FORMATTER'), 102 | 'with' => [ 103 | 'stream' => 'php://stderr', 104 | ], 105 | 'processors' => [PsrLogMessageProcessor::class], 106 | ], 107 | 108 | 'syslog' => [ 109 | 'driver' => 'syslog', 110 | 'level' => env('LOG_LEVEL', 'debug'), 111 | 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), 112 | 'replace_placeholders' => true, 113 | ], 114 | 115 | 'errorlog' => [ 116 | 'driver' => 'errorlog', 117 | 'level' => env('LOG_LEVEL', 'debug'), 118 | 'replace_placeholders' => true, 119 | ], 120 | 121 | 'null' => [ 122 | 'driver' => 'monolog', 123 | 'handler' => NullHandler::class, 124 | ], 125 | 126 | 'emergency' => [ 127 | 'path' => storage_path('logs/laravel.log'), 128 | ], 129 | 130 | ], 131 | 132 | ]; 133 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'log'), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Mailer Configurations 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you may configure all of the mailers used by your application plus 25 | | their respective settings. Several examples have been configured for 26 | | you and you are free to add your own as your application requires. 27 | | 28 | | Laravel supports a variety of mail "transport" drivers that can be used 29 | | when delivering an email. You may specify which one you're using for 30 | | your mailers below. You may also add additional mailers if needed. 31 | | 32 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", 33 | | "postmark", "resend", "log", "array", 34 | | "failover", "roundrobin" 35 | | 36 | */ 37 | 38 | 'mailers' => [ 39 | 40 | 'smtp' => [ 41 | 'transport' => 'smtp', 42 | 'url' => env('MAIL_URL'), 43 | 'host' => env('MAIL_HOST', '127.0.0.1'), 44 | 'port' => env('MAIL_PORT', 2525), 45 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 46 | 'username' => env('MAIL_USERNAME'), 47 | 'password' => env('MAIL_PASSWORD'), 48 | 'timeout' => null, 49 | 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)), 50 | ], 51 | 52 | 'ses' => [ 53 | 'transport' => 'ses', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), 59 | // 'client' => [ 60 | // 'timeout' => 5, 61 | // ], 62 | ], 63 | 64 | 'resend' => [ 65 | 'transport' => 'resend', 66 | ], 67 | 68 | 'sendmail' => [ 69 | 'transport' => 'sendmail', 70 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 71 | ], 72 | 73 | 'log' => [ 74 | 'transport' => 'log', 75 | 'channel' => env('MAIL_LOG_CHANNEL'), 76 | ], 77 | 78 | 'array' => [ 79 | 'transport' => 'array', 80 | ], 81 | 82 | 'failover' => [ 83 | 'transport' => 'failover', 84 | 'mailers' => [ 85 | 'smtp', 86 | 'log', 87 | ], 88 | ], 89 | 90 | 'roundrobin' => [ 91 | 'transport' => 'roundrobin', 92 | 'mailers' => [ 93 | 'ses', 94 | 'postmark', 95 | ], 96 | ], 97 | 98 | ], 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Global "From" Address 103 | |-------------------------------------------------------------------------- 104 | | 105 | | You may wish for all emails sent by your application to be sent from 106 | | the same address. Here you may specify a name and address that is 107 | | used globally for all emails that are sent by your application. 108 | | 109 | */ 110 | 111 | 'from' => [ 112 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 113 | 'name' => env('MAIL_FROM_NAME', 'Example'), 114 | ], 115 | 116 | ]; 117 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'database'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection options for every queue backend 24 | | used by your application. An example configuration is provided for 25 | | each backend supported by Laravel. You're also 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 | 'connection' => env('DB_QUEUE_CONNECTION'), 40 | 'table' => env('DB_QUEUE_TABLE', 'jobs'), 41 | 'queue' => env('DB_QUEUE', 'default'), 42 | 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), 43 | 'after_commit' => false, 44 | ], 45 | 46 | 'beanstalkd' => [ 47 | 'driver' => 'beanstalkd', 48 | 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), 49 | 'queue' => env('BEANSTALKD_QUEUE', 'default'), 50 | 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), 51 | 'block_for' => 0, 52 | 'after_commit' => false, 53 | ], 54 | 55 | 'sqs' => [ 56 | 'driver' => 'sqs', 57 | 'key' => env('AWS_ACCESS_KEY_ID'), 58 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 59 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 60 | 'queue' => env('SQS_QUEUE', 'default'), 61 | 'suffix' => env('SQS_SUFFIX'), 62 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 63 | 'after_commit' => false, 64 | ], 65 | 66 | 'redis' => [ 67 | 'driver' => 'redis', 68 | 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 69 | 'queue' => env('REDIS_QUEUE', 'default'), 70 | 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), 71 | 'block_for' => null, 72 | 'after_commit' => false, 73 | ], 74 | 75 | ], 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Job Batching 80 | |-------------------------------------------------------------------------- 81 | | 82 | | The following options configure the database and table that store job 83 | | batching information. These options can be updated to any database 84 | | connection and table which has been defined by your application. 85 | | 86 | */ 87 | 88 | 'batching' => [ 89 | 'database' => env('DB_CONNECTION', 'sqlite'), 90 | 'table' => 'job_batches', 91 | ], 92 | 93 | /* 94 | |-------------------------------------------------------------------------- 95 | | Failed Queue Jobs 96 | |-------------------------------------------------------------------------- 97 | | 98 | | These options configure the behavior of failed queue job logging so you 99 | | can control how and where failed jobs are stored. Laravel ships with 100 | | support for storing failed jobs in a simple file or in a database. 101 | | 102 | | Supported drivers: "database-uuids", "dynamodb", "file", "null" 103 | | 104 | */ 105 | 106 | 'failed' => [ 107 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 108 | 'database' => env('DB_CONNECTION', 'sqlite'), 109 | 'table' => 'failed_jobs', 110 | ], 111 | 112 | ]; 113 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'token' => env('POSTMARK_TOKEN'), 19 | ], 20 | 21 | 'ses' => [ 22 | 'key' => env('AWS_ACCESS_KEY_ID'), 23 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 24 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 25 | ], 26 | 27 | 'resend' => [ 28 | 'key' => env('RESEND_KEY'), 29 | ], 30 | 31 | 'slack' => [ 32 | 'notifications' => [ 33 | 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), 34 | 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), 35 | ], 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | class UserFactory extends Factory 14 | { 15 | protected $model = User::class; 16 | 17 | /** 18 | * The current password being used by the factory. 19 | */ 20 | protected static ?string $password; 21 | 22 | /** 23 | * Define the model's default state. 24 | * 25 | * @return array 26 | */ 27 | public function definition(): array 28 | { 29 | return [ 30 | 'name' => fake()->name(), 31 | 'email' => fake()->unique()->safeEmail(), 32 | 'email_verified_at' => now(), 33 | 'password' => static::$password ??= Hash::make('password'), 34 | 'remember_token' => Str::random(10), 35 | ]; 36 | } 37 | 38 | /** 39 | * Indicate that the model's email address should be unverified. 40 | */ 41 | public function unverified(): static 42 | { 43 | return $this->state(fn (array $attributes) => [ 44 | 'email_verified_at' => null, 45 | ]); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | $table->string('name'); 16 | $table->string('email')->unique(); 17 | $table->timestamp('email_verified_at')->nullable(); 18 | $table->string('password'); 19 | $table->rememberToken(); 20 | $table->timestamps(); 21 | }); 22 | 23 | Schema::create('password_reset_tokens', function (Blueprint $table) { 24 | $table->string('email')->primary(); 25 | $table->string('token'); 26 | $table->timestamp('created_at')->nullable(); 27 | }); 28 | 29 | Schema::create('sessions', function (Blueprint $table) { 30 | $table->string('id')->primary(); 31 | $table->foreignId('user_id')->nullable()->index(); 32 | $table->string('ip_address', 45)->nullable(); 33 | $table->text('user_agent')->nullable(); 34 | $table->longText('payload'); 35 | $table->integer('last_activity')->index(); 36 | }); 37 | } 38 | 39 | /** 40 | * Reverse the migrations. 41 | */ 42 | public function down(): void 43 | { 44 | Schema::dropIfExists('users'); 45 | Schema::dropIfExists('password_reset_tokens'); 46 | Schema::dropIfExists('sessions'); 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000001_create_cache_table.php: -------------------------------------------------------------------------------- 1 | string('key')->primary(); 15 | $table->mediumText('value'); 16 | $table->integer('expiration'); 17 | }); 18 | 19 | Schema::create('cache_locks', function (Blueprint $table) { 20 | $table->string('key')->primary(); 21 | $table->string('owner'); 22 | $table->integer('expiration'); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('cache'); 32 | Schema::dropIfExists('cache_locks'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000002_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | $table->string('queue')->index(); 16 | $table->longText('payload'); 17 | $table->unsignedTinyInteger('attempts'); 18 | $table->unsignedInteger('reserved_at')->nullable(); 19 | $table->unsignedInteger('available_at'); 20 | $table->unsignedInteger('created_at'); 21 | }); 22 | 23 | Schema::create('job_batches', function (Blueprint $table) { 24 | $table->string('id')->primary(); 25 | $table->string('name'); 26 | $table->integer('total_jobs'); 27 | $table->integer('pending_jobs'); 28 | $table->integer('failed_jobs'); 29 | $table->longText('failed_job_ids'); 30 | $table->mediumText('options')->nullable(); 31 | $table->integer('cancelled_at')->nullable(); 32 | $table->integer('created_at'); 33 | $table->integer('finished_at')->nullable(); 34 | }); 35 | 36 | Schema::create('failed_jobs', function (Blueprint $table) { 37 | $table->id(); 38 | $table->string('uuid')->unique(); 39 | $table->text('connection'); 40 | $table->text('queue'); 41 | $table->longText('payload'); 42 | $table->longText('exception'); 43 | $table->timestamp('failed_at')->useCurrent(); 44 | }); 45 | } 46 | 47 | /** 48 | * Reverse the migrations. 49 | */ 50 | public function down(): void 51 | { 52 | Schema::dropIfExists('jobs'); 53 | Schema::dropIfExists('job_batches'); 54 | Schema::dropIfExists('failed_jobs'); 55 | } 56 | }; 57 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | 18 | User::factory()->create([ 19 | 'name' => 'Test User', 20 | 'email' => 'test@example.com', 21 | ]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docker-compose.local.yml: -------------------------------------------------------------------------------- 1 | services: 2 | laravel: 3 | build: 4 | context: ./docker/local/web 5 | dockerfile: Dockerfile 6 | args: 7 | WWWGROUP: '${WWWGROUP}' 8 | image: sail-8.4/app 9 | extra_hosts: 10 | - 'host.docker.internal:host-gateway' 11 | #ports: 12 | #- '${APP_PORT:-80}:80' not required using Traefik 13 | #- '${VITE_PORT:-5173}:${VITE_PORT:-5173}' Not required if using dev containers (auto forwards port to localhost) 14 | environment: 15 | WWWUSER: '${WWWUSER}' 16 | LARAVEL_SAIL: 1 17 | XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' 18 | XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' 19 | IGNITION_LOCAL_SITES_PATH: '${PWD}' 20 | volumes: 21 | - '.:/var/www/html' 22 | labels: 23 | - "traefik.enable=true" 24 | - "traefik.http.routers.laravel-primevue.rule=Host(`laravel-primevue.localhost`)" 25 | - "traefik.http.services.laravel-primevue.loadbalancer.server.port=80" 26 | networks: 27 | - sail 28 | - proxy 29 | depends_on: 30 | - pgsql 31 | 32 | pgsql: 33 | image: 'postgres:17' 34 | ports: 35 | - '${FORWARD_DB_PORT:-5432}:5432' 36 | environment: 37 | PGPASSWORD: '${DB_PASSWORD:-secret}' 38 | POSTGRES_DB: '${DB_DATABASE}' 39 | POSTGRES_USER: '${DB_USERNAME}' 40 | POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}' 41 | volumes: 42 | - 'laravel-primevue-pgsql:/var/lib/postgresql/data' 43 | - './docker/local/database/pgsql/create-testing-database.sql:/docker-entrypoint-initdb.d/10-create-testing-database.sql' 44 | networks: 45 | - sail 46 | healthcheck: 47 | test: [ "CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}" ] 48 | retries: 3 49 | timeout: 5s 50 | 51 | volumes: 52 | laravel-primevue-pgsql: 53 | driver: local 54 | 55 | networks: 56 | sail: 57 | driver: bridge 58 | proxy: 59 | name: traefik_network 60 | external: true 61 | -------------------------------------------------------------------------------- /docker/local/database/mysql/create-testing-database.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" <<-EOSQL 4 | CREATE DATABASE IF NOT EXISTS testing; 5 | GRANT ALL PRIVILEGES ON \`testing%\`.* TO '$MYSQL_USER'@'%'; 6 | EOSQL 7 | -------------------------------------------------------------------------------- /docker/local/database/pgsql/create-testing-database.sql: -------------------------------------------------------------------------------- 1 | SELECT 'CREATE DATABASE testing' 2 | WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'testing')\gexec 3 | -------------------------------------------------------------------------------- /docker/local/web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:24.04 2 | 3 | LABEL maintainer="Taylor Otwell" 4 | 5 | ARG WWWGROUP 6 | ARG NODE_VERSION=22 7 | ARG MYSQL_CLIENT="mysql-client" 8 | ARG POSTGRES_VERSION=17 9 | 10 | WORKDIR /var/www/html 11 | 12 | ENV DEBIAN_FRONTEND=noninteractive 13 | ENV TZ=UTC 14 | ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80" 15 | ENV SUPERVISOR_PHP_USER="sail" 16 | 17 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 18 | 19 | RUN echo "Acquire::http::Pipeline-Depth 0;" > /etc/apt/apt.conf.d/99custom && \ 20 | echo "Acquire::http::No-Cache true;" >> /etc/apt/apt.conf.d/99custom && \ 21 | echo "Acquire::BrokenProxy true;" >> /etc/apt/apt.conf.d/99custom 22 | 23 | RUN apt-get update && apt-get upgrade -y \ 24 | && mkdir -p /etc/apt/keyrings \ 25 | && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python3 dnsutils librsvg2-bin fswatch ffmpeg nano \ 26 | && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb8dc7e53946656efbce4c1dd71daeaab4ad4cab6' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ 27 | && echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu noble main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ 28 | && apt-get update \ 29 | && apt-get install -y php8.4-cli php8.4-dev \ 30 | php8.4-pgsql php8.4-sqlite3 php8.4-gd \ 31 | php8.4-curl php8.4-mongodb \ 32 | php8.4-imap php8.4-mysql php8.4-mbstring \ 33 | php8.4-xml php8.4-zip php8.4-bcmath php8.4-soap \ 34 | php8.4-intl php8.4-readline \ 35 | php8.4-ldap \ 36 | php8.4-msgpack php8.4-igbinary php8.4-redis php8.4-swoole \ 37 | php8.4-memcached php8.4-pcov php8.4-imagick php8.4-xdebug \ 38 | && curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \ 39 | && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ 40 | && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ 41 | && apt-get update \ 42 | && apt-get install -y nodejs \ 43 | && npm install -g npm \ 44 | && npm install -g pnpm \ 45 | && npm install -g bun \ 46 | && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \ 47 | && echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ 48 | && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \ 49 | && echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ 50 | && apt-get update \ 51 | && apt-get install -y yarn \ 52 | && apt-get install -y $MYSQL_CLIENT \ 53 | && apt-get install -y postgresql-client-$POSTGRES_VERSION \ 54 | && apt-get -y autoremove \ 55 | && apt-get clean \ 56 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 57 | 58 | RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.4 59 | 60 | RUN userdel -r ubuntu 61 | RUN groupadd --force -g $WWWGROUP sail 62 | RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail 63 | 64 | COPY start-container /usr/local/bin/start-container 65 | COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf 66 | COPY php.ini /etc/php/8.4/cli/conf.d/99-sail.ini 67 | RUN chmod +x /usr/local/bin/start-container 68 | 69 | EXPOSE 80/tcp 70 | 71 | ENTRYPOINT ["start-container"] 72 | -------------------------------------------------------------------------------- /docker/local/web/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | variables_order = EGPCS 5 | pcov.directory = . 6 | -------------------------------------------------------------------------------- /docker/local/web/start-container: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$SUPERVISOR_PHP_USER" != "root" ] && [ "$SUPERVISOR_PHP_USER" != "sail" ]; then 4 | echo "You should set SUPERVISOR_PHP_USER to either 'sail' or 'root'." 5 | exit 1 6 | fi 7 | 8 | if [ ! -z "$WWWUSER" ]; then 9 | usermod -u $WWWUSER sail 10 | fi 11 | 12 | if [ ! -d /.composer ]; then 13 | mkdir /.composer 14 | fi 15 | 16 | chmod -R ugo+rw /.composer 17 | 18 | if [ $# -gt 0 ]; then 19 | if [ "$SUPERVISOR_PHP_USER" = "root" ]; then 20 | exec "$@" 21 | else 22 | exec gosu $WWWUSER "$@" 23 | fi 24 | else 25 | exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf 26 | fi 27 | -------------------------------------------------------------------------------- /docker/local/web/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | user=root 4 | logfile=/var/log/supervisor/supervisord.log 5 | pidfile=/var/run/supervisord.pid 6 | 7 | [program:php] 8 | command=%(ENV_SUPERVISOR_PHP_COMMAND)s 9 | user=%(ENV_SUPERVISOR_PHP_USER)s 10 | environment=LARAVEL_SAIL="1" 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | import vue from 'eslint-plugin-vue'; 2 | import { 3 | defineConfigWithVueTs, 4 | vueTsConfigs, 5 | } from '@vue/eslint-config-typescript'; 6 | import eslint from '@eslint/js'; 7 | import globals from 'globals'; 8 | 9 | export default [ 10 | // Global ignores 11 | { 12 | ignores: [ 13 | 'node_modules', 14 | 'vendor', 15 | 'dist', 16 | 'public', 17 | 'bootstrap/ssr', 18 | ], 19 | }, 20 | // JavaScript files 21 | { 22 | files: ['**/*.js'], 23 | ...eslint.configs.recommended, 24 | languageOptions: { 25 | ecmaVersion: 'latest', 26 | sourceType: 'module', 27 | globals: { 28 | ...globals.browser, 29 | ...globals.node, 30 | process: 'readonly', 31 | module: 'readonly', 32 | require: 'readonly', 33 | window: 'readonly', 34 | }, 35 | }, 36 | }, 37 | // Vue and TypeScript files 38 | ...defineConfigWithVueTs( 39 | vue.configs['flat/recommended'], 40 | vueTsConfigs.recommended, 41 | { 42 | rules: { 43 | 'vue/require-default-prop': 'off', 44 | 'vue/attribute-hyphenation': 'off', 45 | 'vue/v-on-event-hyphenation': 'off', 46 | 'vue/multi-word-component-names': 'off', 47 | 'vue/block-lang': 'off', 48 | 'vue/no-v-html': 'off', 49 | 'vue/html-indent': ['error', 4], 50 | '@typescript-eslint/no-explicit-any': 'off', 51 | indent: ['error', 4], 52 | semi: ['error', 'always'], 53 | 'linebreak-style': ['error', 'unix'], 54 | }, 55 | } 56 | ), 57 | ]; 58 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build && vite build --ssr", 6 | "dev": "vite", 7 | "lint": "eslint . --fix" 8 | }, 9 | "dependencies": { 10 | "@inertiajs/vue3": "^2.0.5", 11 | "@primeuix/themes": "^1.0.0", 12 | "@primevue/auto-import-resolver": "^4.3.3", 13 | "@tailwindcss/vite": "^4.0.17", 14 | "@types/lodash-es": "^4.17.12", 15 | "@types/qs": "^6.9.18", 16 | "@vitejs/plugin-vue": "^5.2.3", 17 | "@vue/server-renderer": "^3.5.14", 18 | "@vueuse/core": "^13.0.0", 19 | "@vueuse/integrations": "^13.2.0", 20 | "globals": "^16.0.0", 21 | "laravel-vite-plugin": "^1.2.0", 22 | "lodash-es": "^4.17.21", 23 | "lucide-vue-next": "^0.485.0", 24 | "primevue": "^4.3.3", 25 | "qs": "^6.14.0", 26 | "tailwind-merge": "^3.2.0", 27 | "tailwindcss": "^4.0.17", 28 | "tailwindcss-primeui": "^0.6.1", 29 | "typescript": "^5.8.2", 30 | "universal-cookie": "^7.2.2", 31 | "unplugin-vue-components": "^28.4.1", 32 | "vite": "^6.2.3", 33 | "vue": "^3.5.13", 34 | "ziggy-js": "^2.5.2" 35 | }, 36 | "devDependencies": { 37 | "@eslint/js": "^9.18.0", 38 | "@typescript-eslint/eslint-plugin": "^8.19.1", 39 | "@typescript-eslint/parser": "^8.19.1", 40 | "@vue/eslint-config-typescript": "^14.5.0", 41 | "eslint": "^9.18.0", 42 | "eslint-config-prettier": "^9.1.0", 43 | "eslint-plugin-vue": "^9.32.0", 44 | "typescript-eslint": "^8.19.1", 45 | "vue-tsc": "^2.2.8" 46 | }, 47 | "optionalDependencies": { 48 | "@rollup/rollup-linux-x64-gnu": "4.37.0", 49 | "@tailwindcss/oxide-linux-x64-gnu": "^4.0.1", 50 | "lightningcss-linux-x64-gnu": "^1.29.1" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - vendor/larastan/larastan/extension.neon 3 | - vendor/nesbot/carbon/extension.neon 4 | 5 | parameters: 6 | level: 8 7 | treatPhpDocTypesAsCertain: false 8 | paths: 9 | - app 10 | - database/factories 11 | - database/seeders 12 | - routes 13 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | tests/Unit 10 | 11 | 12 | tests/Feature 13 | 14 | 15 | 16 | 17 | app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /pint.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "psr12", 3 | "rules": { 4 | "array_indentation": true, 5 | "array_syntax": true, 6 | "fully_qualified_strict_types": true, 7 | "method_chaining_indentation": true, 8 | "no_trailing_comma_in_singleline_function_call": true, 9 | "no_trailing_comma_in_singleline": true, 10 | "no_unused_imports": true, 11 | "no_whitespace_before_comma_in_array": true, 12 | "single_import_per_statement": true, 13 | "whitespace_after_comma_in_array": true, 14 | "trailing_comma_in_multiline": false 15 | } 16 | } -------------------------------------------------------------------------------- /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/connorabbas/laravel-primevue-starter-kit/251b07ff2860de9c7bd4126ee47d002bf73d6e56/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | html { 2 | /* font size will determine the component/utility scaling */ 3 | font-size: 14px; 4 | } 5 | 6 | body { 7 | margin: 0 !important; 8 | padding: 0 !important; 9 | } 10 | 11 | #app { 12 | visibility: hidden; 13 | } 14 | 15 | #nprogress .bar { 16 | z-index: 9999999 !important; 17 | } 18 | 19 | .lucide { 20 | width: 16px; 21 | height: 16px; 22 | } -------------------------------------------------------------------------------- /resources/css/custom-preflight.css: -------------------------------------------------------------------------------- 1 | /*! modern-normalize v3.0.1 | MIT License | https://github.com/sindresorhus/modern-normalize */ 2 | 3 | /* 4 | Document 5 | ======== 6 | */ 7 | 8 | /** 9 | Use a better box model (opinionated). 10 | */ 11 | 12 | *, 13 | ::before, 14 | ::after { 15 | box-sizing: border-box; 16 | } 17 | 18 | html { 19 | /* Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) */ 20 | font-family: 21 | system-ui, 22 | 'Segoe UI', 23 | Roboto, 24 | Helvetica, 25 | Arial, 26 | sans-serif, 27 | 'Apple Color Emoji', 28 | 'Segoe UI Emoji'; 29 | line-height: 1.15; 30 | /* 1. Correct the line height in all browsers. */ 31 | -webkit-text-size-adjust: 100%; 32 | /* 2. Prevent adjustments of font size after orientation changes in iOS. */ 33 | tab-size: 4; 34 | /* 3. Use a more readable tab size (opinionated). */ 35 | } 36 | 37 | /* 38 | Sections 39 | ======== 40 | */ 41 | 42 | body { 43 | margin: 0; 44 | /* Remove the margin in all browsers. */ 45 | } 46 | 47 | /* 48 | Text-level semantics 49 | ==================== 50 | */ 51 | 52 | /** 53 | Add the correct font weight in Chrome and Safari. 54 | */ 55 | 56 | b, 57 | strong { 58 | font-weight: bolder; 59 | } 60 | 61 | /** 62 | 1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) 63 | 2. Correct the odd 'em' font sizing in all browsers. 64 | */ 65 | 66 | code, 67 | kbd, 68 | samp, 69 | pre { 70 | font-family: 71 | ui-monospace, 72 | SFMono-Regular, 73 | Consolas, 74 | 'Liberation Mono', 75 | Menlo, 76 | monospace; 77 | /* 1 */ 78 | font-size: 1em; 79 | /* 2 */ 80 | } 81 | 82 | /** 83 | Add the correct font size in all browsers. 84 | */ 85 | 86 | small { 87 | font-size: 80%; 88 | } 89 | 90 | /** 91 | Prevent 'sub' and 'sup' elements from affecting the line height in all browsers. 92 | */ 93 | 94 | sub, 95 | sup { 96 | font-size: 75%; 97 | line-height: 0; 98 | position: relative; 99 | vertical-align: baseline; 100 | } 101 | 102 | sub { 103 | bottom: -0.25em; 104 | } 105 | 106 | sup { 107 | top: -0.5em; 108 | } 109 | 110 | /* 111 | Tabular data 112 | ============ 113 | */ 114 | 115 | /** 116 | Correct table border color inheritance in Chrome and Safari. (https://issues.chromium.org/issues/40615503, https://bugs.webkit.org/show_bug.cgi?id=195016) 117 | */ 118 | 119 | table { 120 | border-color: currentcolor; 121 | } 122 | 123 | /* 124 | Forms 125 | ===== 126 | */ 127 | 128 | /** 129 | 1. Change the font styles in all browsers. 130 | 2. Remove the margin in Firefox and Safari. 131 | */ 132 | 133 | button, 134 | input, 135 | optgroup, 136 | select, 137 | textarea { 138 | font-family: inherit; 139 | /* 1 */ 140 | font-size: 100%; 141 | /* 1 */ 142 | line-height: 1.15; 143 | /* 1 */ 144 | margin: 0; 145 | /* 2 */ 146 | } 147 | 148 | /** 149 | Correct the inability to style clickable types in iOS and Safari. 150 | */ 151 | 152 | button, 153 | [type='button'], 154 | [type='reset'], 155 | [type='submit'] { 156 | -webkit-appearance: button; 157 | } 158 | 159 | /** 160 | Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers. 161 | */ 162 | 163 | legend { 164 | padding: 0; 165 | } 166 | 167 | /** 168 | Add the correct vertical alignment in Chrome and Firefox. 169 | */ 170 | 171 | progress { 172 | vertical-align: baseline; 173 | } 174 | 175 | /** 176 | Correct the cursor style of increment and decrement buttons in Safari. 177 | */ 178 | 179 | ::-webkit-inner-spin-button, 180 | ::-webkit-outer-spin-button { 181 | height: auto; 182 | } 183 | 184 | /** 185 | 1. Correct the odd appearance in Chrome and Safari. 186 | 2. Correct the outline style in Safari. 187 | */ 188 | 189 | [type='search'] { 190 | -webkit-appearance: textfield; 191 | /* 1 */ 192 | outline-offset: -2px; 193 | /* 2 */ 194 | } 195 | 196 | /** 197 | Remove the inner padding in Chrome and Safari on macOS. 198 | */ 199 | 200 | ::-webkit-search-decoration { 201 | -webkit-appearance: none; 202 | } 203 | 204 | /** 205 | 1. Correct the inability to style clickable types in iOS and Safari. 206 | 2. Change font properties to 'inherit' in Safari. 207 | */ 208 | 209 | ::-webkit-file-upload-button { 210 | -webkit-appearance: button; 211 | /* 1 */ 212 | font: inherit; 213 | /* 2 */ 214 | } 215 | 216 | /* 217 | Interactive 218 | =========== 219 | */ 220 | 221 | /* 222 | Add the correct display in Chrome and Safari. 223 | */ 224 | 225 | summary { 226 | display: list-item; 227 | } 228 | 229 | /* 230 | Tailwind Additions 231 | https://tailwindcss.com/docs/preflight 232 | */ 233 | 234 | blockquote, 235 | dl, 236 | dd, 237 | h1, 238 | h2, 239 | h3, 240 | h4, 241 | h5, 242 | h6, 243 | hr, 244 | figure, 245 | p, 246 | pre { 247 | margin: 0; 248 | } 249 | 250 | h1, 251 | h2, 252 | h3, 253 | h4, 254 | h5, 255 | h6 { 256 | font-size: inherit; 257 | font-weight: inherit; 258 | } 259 | 260 | ol, 261 | ul { 262 | list-style: none; 263 | margin: 0; 264 | padding: 0; 265 | } 266 | 267 | img, 268 | svg, 269 | video, 270 | canvas, 271 | audio, 272 | iframe, 273 | embed, 274 | object { 275 | display: block; 276 | vertical-align: middle; 277 | } 278 | 279 | img, 280 | video { 281 | max-width: 100%; 282 | height: auto; 283 | } 284 | 285 | *, 286 | ::before, 287 | ::after { 288 | border-width: 0; 289 | border-style: solid; 290 | border-color: theme('borderColor.DEFAULT', currentColor); 291 | } -------------------------------------------------------------------------------- /resources/css/tailwind.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/theme.css' layer(tailwind-theme); 2 | @import './custom-preflight.css' layer(tailwind-base); 3 | @import 'tailwindcss/utilities.css' layer(tailwind-utilities); 4 | @import 'tailwindcss-primeui'; 5 | 6 | @source '../../storage/framework/views/*.php'; 7 | @source '../../resources/views/**/*.blade.php'; 8 | @source '../../resources/js/**/*.vue'; 9 | 10 | @custom-variant dark (&:where(.dark, .dark *)); 11 | 12 | @theme { 13 | --font-sans: Inter, sans-serif; 14 | } 15 | 16 | @utility dynamic-bg { 17 | @apply bg-surface-0 dark:bg-surface-900; 18 | } 19 | 20 | @utility dynamic-border { 21 | @apply border-surface-200 dark:border-surface-800; 22 | } -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import '../css/app.css'; 2 | import '../css/tailwind.css'; 3 | 4 | import { createSSRApp, h } from 'vue'; 5 | import { createInertiaApp, Head, Link } from '@inertiajs/vue3'; 6 | import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; 7 | import { ZiggyVue } from '../../vendor/tightenco/ziggy'; 8 | 9 | import PrimeVue from 'primevue/config'; 10 | import ToastService from 'primevue/toastservice'; 11 | 12 | import Container from '@/components/Container.vue'; 13 | import PageTitleSection from '@/components/PageTitleSection.vue'; 14 | 15 | import { useSiteColorMode } from '@/composables/useSiteColorMode'; 16 | import themePreset from '@/theme/noir-preset'; 17 | 18 | /* global Ziggy */ 19 | const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; 20 | 21 | createInertiaApp({ 22 | title: (title) => `${title} - ${appName}`, 23 | resolve: (name) => 24 | resolvePageComponent( 25 | `./pages/${name}.vue`, 26 | import.meta.glob('./pages/**/*.vue') 27 | ), 28 | setup({ el, App, props, plugin }) { 29 | // Site light/dark mode 30 | const colorMode = useSiteColorMode({ emitAuto: true }); 31 | 32 | const app = createSSRApp({ render: () => h(App, props) }) 33 | .use(plugin) 34 | .use(ZiggyVue, Ziggy) 35 | .use(PrimeVue, { 36 | theme: { 37 | preset: themePreset, 38 | options: { 39 | darkModeSelector: '.dark', 40 | cssLayer: { 41 | name: 'primevue', 42 | order: 'tailwind-theme, tailwind-base, primevue, tailwind-utilities', 43 | }, 44 | }, 45 | }, 46 | }) 47 | .use(ToastService) 48 | .component('InertiaHead', Head) 49 | .component('InertiaLink', Link) 50 | .component('Container', Container) 51 | .component('PageTitleSection', PageTitleSection) 52 | .provide('colorMode', colorMode) 53 | .mount(el); 54 | 55 | // #app content set to hidden by default 56 | // reduces jumpy initial render from SSR content (unstyled PrimeVue components) 57 | el.style.visibility = 'visible'; 58 | 59 | return app; 60 | }, 61 | progress: { 62 | color: 'var(--p-primary-500)', 63 | }, 64 | }); 65 | -------------------------------------------------------------------------------- /resources/js/components/ApplicationLogo.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /resources/js/components/ClientOnly.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /resources/js/components/Container.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | -------------------------------------------------------------------------------- /resources/js/components/DeleteUserModal.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 89 | -------------------------------------------------------------------------------- /resources/js/components/FlashMessages.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 64 | -------------------------------------------------------------------------------- /resources/js/components/NavLogoLink.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /resources/js/components/PageTitleSection.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/js/components/SelectColorModeButton.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 30 | -------------------------------------------------------------------------------- /resources/js/components/ThemePresetSelector.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /resources/js/components/primevue/menu/Breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 76 | -------------------------------------------------------------------------------- /resources/js/components/primevue/menu/ContextMenu.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 77 | -------------------------------------------------------------------------------- /resources/js/components/primevue/menu/Menu.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 82 | -------------------------------------------------------------------------------- /resources/js/components/primevue/menu/Menubar.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 93 | -------------------------------------------------------------------------------- /resources/js/components/primevue/menu/PanelMenu.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | -------------------------------------------------------------------------------- /resources/js/components/primevue/menu/TabMenu.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 72 | -------------------------------------------------------------------------------- /resources/js/components/primevue/menu/TieredMenu.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 86 | -------------------------------------------------------------------------------- /resources/js/composables/useAppLayout.ts: -------------------------------------------------------------------------------- 1 | import { ref, computed, onMounted, onUnmounted, watchEffect } from 'vue'; 2 | import { usePage, useForm } from '@inertiajs/vue3'; 3 | import { LayoutGrid, House, Info, Settings, LogOut, ExternalLink, FileSearch, FolderGit2 } from 'lucide-vue-next'; 4 | import { MenuItem } from '@/types'; 5 | 6 | export function useAppLayout() { 7 | const page = usePage(); 8 | const currentRoute = computed(() => { 9 | // Access page.url to trigger re-computation on navigation. 10 | /* eslint-disable @typescript-eslint/no-unused-vars */ 11 | const url = page.url; 12 | /* eslint-enable @typescript-eslint/no-unused-vars */ 13 | return route().current(); 14 | }); 15 | 16 | // Menu items 17 | const menuItems = computed(() => [ 18 | { 19 | label: 'Home', 20 | lucideIcon: House, 21 | route: route('welcome'), 22 | active: currentRoute.value == 'welcome', 23 | }, 24 | { 25 | label: 'Dashboard', 26 | lucideIcon: LayoutGrid, 27 | route: route('dashboard'), 28 | active: currentRoute.value == 'dashboard', 29 | }, 30 | { 31 | label: 'Resources', 32 | lucideIcon: Info, 33 | items: [ 34 | { 35 | label: 'Laravel Docs', 36 | url: 'https://laravel.com/docs/master', 37 | target: '_blank', 38 | lucideIcon: ExternalLink, 39 | }, 40 | { 41 | label: 'PrimeVue Docs', 42 | url: 'https://primevue.org/', 43 | target: '_blank', 44 | lucideIcon: ExternalLink, 45 | }, 46 | { 47 | label: 'Starter Kit Docs', 48 | url: 'https://connorabbas.github.io/laravel-primevue-starter-kit-docs/', 49 | target: '_blank', 50 | lucideIcon: FileSearch, 51 | }, 52 | { 53 | label: 'Starter Kit Repo', 54 | url: 'https://github.com/connorabbas/laravel-primevue-starter-kit', 55 | target: '_blank', 56 | lucideIcon: FolderGit2, 57 | }, 58 | ], 59 | }, 60 | ]); 61 | 62 | // User menu and logout functionality. 63 | const logoutForm = useForm({}); 64 | const logout = () => { 65 | logoutForm.post(route('logout')); 66 | }; 67 | const userMenuItems: MenuItem[] = [ 68 | { 69 | label: 'Settings', 70 | route: route('profile.edit'), 71 | lucideIcon: Settings, 72 | }, 73 | { 74 | separator: true 75 | }, 76 | { 77 | label: 'Log out', 78 | lucideIcon: LogOut, 79 | command: () => logout(), 80 | }, 81 | ]; 82 | 83 | // Mobile menu 84 | const mobileMenuOpen = ref(false); 85 | if (typeof window !== 'undefined') { 86 | const windowWidth = ref(window.innerWidth); 87 | const updateWidth = () => { 88 | windowWidth.value = window.innerWidth; 89 | }; 90 | onMounted(() => { 91 | window.addEventListener('resize', updateWidth); 92 | }); 93 | onUnmounted(() => { 94 | window.removeEventListener('resize', updateWidth); 95 | }); 96 | watchEffect(() => { 97 | if (windowWidth.value > 1024) { 98 | mobileMenuOpen.value = false; 99 | } 100 | }); 101 | } 102 | 103 | return { 104 | currentRoute, 105 | menuItems, 106 | userMenuItems, 107 | mobileMenuOpen, 108 | logout, 109 | }; 110 | } 111 | -------------------------------------------------------------------------------- /resources/js/composables/useLazyDataTable.ts: -------------------------------------------------------------------------------- 1 | import { toRaw } from 'vue'; 2 | import type { Page, PageProps } from '@inertiajs/core'; 3 | import { DataTableFilterMetaData, DataTableFilterEvent, DataTableSortEvent } from 'primevue'; 4 | import { PrimeVueDataFilters, InertiaRouterFetchCallbacks } from '@/types'; 5 | import { usePaginatedData } from './usePaginatedData'; 6 | 7 | export function useLazyDataTable( 8 | propDataToFetch: string | string[], 9 | initialFilters: PrimeVueDataFilters = {}, 10 | initialRows: number = 20 11 | ) { 12 | const { 13 | processing, 14 | filters, 15 | sorting, 16 | pagination, 17 | firstDatasetIndex, 18 | filteredOrSorted, 19 | debounceInputFilter, 20 | scrollToTop, 21 | fetchData, 22 | paginate, 23 | hardReset, 24 | } = usePaginatedData(propDataToFetch, initialFilters, initialRows); 25 | 26 | function parseEventFilterValues() { 27 | Object.keys(filters.value).forEach((key) => { 28 | const filter = filters.value[key]; 29 | // empty arrays can cause filtering issues, set to null instead 30 | if (Array.isArray(filter.value) && filter.value.length === 0) { 31 | filters.value[key].value = null; 32 | } 33 | }); 34 | } 35 | 36 | /** 37 | * "Override" parent composable function 38 | * Event-driven filtering rather than reactive state 39 | */ 40 | function filter(event: DataTableFilterEvent): void { 41 | pagination.value.page = 1; 42 | const newFilters: PrimeVueDataFilters = {}; 43 | 44 | Object.entries(event.filters).forEach(([key, rawFilter]) => { 45 | if ( 46 | rawFilter && 47 | typeof rawFilter === 'object' && 48 | 'matchMode' in rawFilter 49 | ) { 50 | newFilters[key] = rawFilter as DataTableFilterMetaData; 51 | } 52 | }); 53 | 54 | filters.value = newFilters; 55 | parseEventFilterValues(); 56 | 57 | fetchData({ 58 | onFinish: () => { 59 | scrollToTop(); 60 | }, 61 | }); 62 | } 63 | 64 | function sort(event: DataTableSortEvent): void { 65 | pagination.value.page = 1; 66 | sorting.value.field = event.sortField ? String(event.sortField) : ''; 67 | sorting.value.order = event.sortOrder || 1; 68 | 69 | fetchData({ 70 | onFinish: () => { 71 | scrollToTop(); 72 | }, 73 | }); 74 | } 75 | 76 | /** 77 | * "Override" parent composable function 78 | * usePaginatedData() resets sorting.value state as a new object, this will not work for DataTable's 79 | */ 80 | function reset(options: InertiaRouterFetchCallbacks = {}): Promise> { 81 | const { onFinish: onFinishCallback, onSuccess, onError } = options; 82 | 83 | const defaultFilters = structuredClone(toRaw(initialFilters)); 84 | Object.keys(defaultFilters).forEach((key) => { 85 | filters.value[key].value = defaultFilters[key].value; 86 | }); 87 | sorting.value.field = ''; 88 | sorting.value.order = 1; 89 | pagination.value.page = 1; 90 | pagination.value.rows = initialRows; 91 | 92 | return fetchData({ 93 | onSuccess, 94 | onError, 95 | onFinish: () => { 96 | scrollToTop(); 97 | onFinishCallback?.(); 98 | }, 99 | }); 100 | } 101 | 102 | return { 103 | processing, 104 | filters, 105 | sorting, 106 | pagination, 107 | firstDatasetIndex, 108 | filteredOrSorted, 109 | debounceInputFilter, 110 | fetchData, 111 | paginate, 112 | filter, 113 | sort, 114 | reset, 115 | hardReset, 116 | }; 117 | } 118 | -------------------------------------------------------------------------------- /resources/js/composables/useSiteColorMode.ts: -------------------------------------------------------------------------------- 1 | import { useColorMode, type BasicColorSchema, type UseColorModeOptions } from '@vueuse/core'; 2 | import { useCookies } from '@vueuse/integrations/useCookies'; 3 | import type { CookieSetOptions } from 'universal-cookie'; 4 | import { watch } from 'vue'; 5 | 6 | interface SiteColorModeOptions extends UseColorModeOptions { 7 | cookieKey?: string; 8 | cookieOpts?: CookieSetOptions; 9 | cookieColorMode?: BasicColorSchema; 10 | } 11 | 12 | export function useSiteColorMode(opts: SiteColorModeOptions = {}) { 13 | const { 14 | cookieKey = 'colorScheme', 15 | cookieOpts: userOpts, 16 | cookieColorMode, 17 | ...rest 18 | } = opts; 19 | 20 | // a maxAge in seconds (365 days) 21 | const defaultOpts: CookieSetOptions = { 22 | path: '/', 23 | maxAge: 365 * 24 * 60 * 60, 24 | sameSite: 'lax', 25 | }; 26 | 27 | const finalCookieOpts = { ...defaultOpts, ...userOpts }; 28 | 29 | const cookies = useCookies([cookieKey]); 30 | const initialValue: BasicColorSchema = typeof window === 'undefined' 31 | ? (cookieColorMode ?? 'auto') 32 | : (cookies.get(cookieKey) as BasicColorSchema) ?? 'auto'; 33 | 34 | const colorMode = useColorMode({ initialValue, ...rest }); 35 | 36 | if (typeof window !== 'undefined') { 37 | watch(colorMode, (mode) => { 38 | cookies.set(cookieKey, mode, finalCookieOpts); 39 | }); 40 | } 41 | 42 | return colorMode; 43 | } 44 | -------------------------------------------------------------------------------- /resources/js/composables/useThemePreset.ts: -------------------------------------------------------------------------------- 1 | import { ref, Ref } from 'vue'; 2 | import { usePreset } from '@primeuix/themes'; 3 | import { Preset } from '@primeuix/themes/types'; 4 | import { useStorage } from '@vueuse/core'; 5 | import bootstrap from '@/theme/bootstrap-preset'; 6 | import breeze from '@/theme/breeze-preset'; 7 | import enterprise from '@/theme/enterprise-preset'; 8 | import noir from '@/theme/noir-preset'; 9 | import warm from '@/theme/warm-preset'; 10 | 11 | interface ThemePreset { 12 | label: string, 13 | value: string, 14 | preset: Preset, 15 | } 16 | 17 | const presets = ref([ 18 | { label: 'Bootstrap', value: 'bootstrap', preset: bootstrap }, 19 | { label: 'Breeze', value: 'breeze', preset: breeze }, 20 | { label: 'Enterprise', value: 'enterprise', preset: enterprise }, 21 | { label: 'Noir', value: 'noir', preset: noir }, 22 | { label: 'Warm', value: 'warm', preset: warm }, 23 | ]); 24 | 25 | const selectedPreset: Ref = useStorage('theme-preset', 'noir'); 26 | 27 | function getCurrentPreset(): Preset { 28 | return ( 29 | presets.value.find((p) => p.value === selectedPreset.value)?.preset || 30 | presets.value[3].preset 31 | ); 32 | } 33 | 34 | function setPreset(presetValue: string): void { 35 | const themePreset = presets.value.find((p) => p.value === presetValue); 36 | if (themePreset) { 37 | usePreset(themePreset.preset); 38 | } 39 | } 40 | 41 | setPreset(selectedPreset.value); 42 | 43 | export function useThemePreset() { 44 | return { 45 | presets, 46 | selectedPreset, 47 | getCurrentPreset, 48 | setPreset, 49 | }; 50 | } -------------------------------------------------------------------------------- /resources/js/layouts/AppLayout.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /resources/js/layouts/GuestAuthLayout.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 54 | -------------------------------------------------------------------------------- /resources/js/layouts/UserSettingsLayout.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 69 | -------------------------------------------------------------------------------- /resources/js/pages/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | -------------------------------------------------------------------------------- /resources/js/pages/Error.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | -------------------------------------------------------------------------------- /resources/js/pages/Welcome.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 123 | -------------------------------------------------------------------------------- /resources/js/pages/auth/ConfirmPassword.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 69 | -------------------------------------------------------------------------------- /resources/js/pages/auth/ForgotPassword.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 104 | -------------------------------------------------------------------------------- /resources/js/pages/auth/Login.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 159 | -------------------------------------------------------------------------------- /resources/js/pages/auth/Register.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 154 | -------------------------------------------------------------------------------- /resources/js/pages/auth/ResetPassword.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 133 | -------------------------------------------------------------------------------- /resources/js/pages/auth/VerifyEmail.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 77 | -------------------------------------------------------------------------------- /resources/js/pages/settings/Appearance.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 34 | -------------------------------------------------------------------------------- /resources/js/ssr.js: -------------------------------------------------------------------------------- 1 | import { createInertiaApp, Head, Link } from '@inertiajs/vue3'; 2 | import createServer from '@inertiajs/vue3/server'; 3 | 4 | import { renderToString } from '@vue/server-renderer'; 5 | import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; 6 | import { createSSRApp, h } from 'vue'; 7 | 8 | import { route as ziggyRoute } from 'ziggy-js'; 9 | 10 | import PrimeVue from 'primevue/config'; 11 | import ToastService from 'primevue/toastservice'; 12 | 13 | import Container from '@/components/Container.vue'; 14 | import PageTitleSection from '@/components/PageTitleSection.vue'; 15 | import { useSiteColorMode } from '@/composables/useSiteColorMode'; 16 | 17 | const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; 18 | 19 | createServer((page) => 20 | createInertiaApp({ 21 | page, 22 | render: renderToString, 23 | title: (title) => `${title} - ${appName}`, 24 | resolve: (name) => resolvePageComponent( 25 | `./pages/${name}.vue`, 26 | import.meta.glob('./pages/**/*.vue') 27 | ), 28 | setup({ App, props, plugin }) { 29 | // Color mode set from cookie on the server 30 | const cookieColorMode = props.initialPage.props.colorScheme; 31 | const colorMode = useSiteColorMode({ 32 | cookieColorMode, 33 | emitAuto: true, 34 | }); 35 | 36 | // Create app 37 | const app = createSSRApp({ render: () => h(App, props) }); 38 | 39 | // Configure Ziggy for SSR 40 | const ziggyConfig = { 41 | ...page.props.ziggy, 42 | location: new URL(page.props.ziggy.location), 43 | }; 44 | const route = (name, params, absolute) => ziggyRoute(name, params, absolute, ziggyConfig); 45 | app.config.globalProperties.route = route; 46 | if (typeof window === 'undefined') { 47 | global.route = route; 48 | } 49 | 50 | app.use(plugin) 51 | .use(PrimeVue, { theme: 'none' }) // PrimeVue won't render it's styles server side 52 | .use(ToastService) 53 | .component('InertiaHead', Head) 54 | .component('InertiaLink', Link) 55 | .component('Container', Container) 56 | .component('PageTitleSection', PageTitleSection) 57 | .provide('colorMode', colorMode); 58 | 59 | return app; 60 | }, 61 | }) 62 | ); 63 | -------------------------------------------------------------------------------- /resources/js/theme/bootstrap-preset.js: -------------------------------------------------------------------------------- 1 | import Preset from '@primeuix/themes/lara'; 2 | import { definePreset } from '@primeuix/themes'; 3 | 4 | const customThemePreset = definePreset(Preset, { 5 | semantic: { 6 | primary: { 7 | 50: '{blue.50}', 8 | 100: '{blue.100}', 9 | 200: '{blue.200}', 10 | 300: '{blue.300}', 11 | 400: '{blue.400}', 12 | 500: '{blue.500}', 13 | 600: '{blue.600}', 14 | 700: '{blue.700}', 15 | 800: '{blue.800}', 16 | 900: '{blue.900}', 17 | 950: '{blue.950}', 18 | }, 19 | colorScheme: { 20 | light: { 21 | surface: { 22 | 50: '{slate.50}', 23 | 100: '{slate.100}', 24 | 200: '{slate.200}', 25 | 300: '{slate.300}', 26 | 400: '{slate.400}', 27 | 500: '{slate.500}', 28 | 600: '{slate.600}', 29 | 700: '{slate.700}', 30 | 800: '{slate.800}', 31 | 900: '{slate.900}', 32 | 950: '{slate.950}', 33 | }, 34 | }, 35 | dark: { 36 | surface: { 37 | 50: '{slate.50}', 38 | 100: '{slate.100}', 39 | 200: '{slate.200}', 40 | 300: '{slate.300}', 41 | 400: '{slate.400}', 42 | 500: '{slate.500}', 43 | 600: '{slate.600}', 44 | 700: '{slate.700}', 45 | 800: '{slate.800}', 46 | 900: '{slate.900}', 47 | 950: '{slate.950}', 48 | }, 49 | }, 50 | }, 51 | }, 52 | }); 53 | 54 | export default customThemePreset; 55 | -------------------------------------------------------------------------------- /resources/js/theme/breeze-preset.js: -------------------------------------------------------------------------------- 1 | import Preset from '@primeuix/themes/aura'; 2 | import { definePreset } from '@primeuix/themes'; 3 | 4 | const customThemePreset = definePreset(Preset, { 5 | semantic: { 6 | primary: { 7 | 50: '{indigo.50}', 8 | 100: '{indigo.100}', 9 | 200: '{indigo.200}', 10 | 300: '{indigo.300}', 11 | 400: '{indigo.400}', 12 | 500: '{indigo.500}', 13 | 600: '{indigo.600}', 14 | 700: '{indigo.700}', 15 | 800: '{indigo.800}', 16 | 900: '{indigo.900}', 17 | 950: '{indigo.950}', 18 | }, 19 | colorScheme: { 20 | light: { 21 | surface: { 22 | 50: '{gray.50}', 23 | 100: '{gray.100}', 24 | 200: '{gray.200}', 25 | 300: '{gray.300}', 26 | 400: '{gray.400}', 27 | 500: '{gray.500}', 28 | 600: '{gray.600}', 29 | 700: '{gray.700}', 30 | 800: '{gray.800}', 31 | 900: '{gray.900}', 32 | 950: '{gray.950}', 33 | }, 34 | }, 35 | dark: { 36 | surface: { 37 | 50: '{gray.50}', 38 | 100: '{gray.100}', 39 | 200: '{gray.200}', 40 | 300: '{gray.300}', 41 | 400: '{gray.400}', 42 | 500: '{gray.500}', 43 | 600: '{gray.600}', 44 | 700: '{gray.700}', 45 | 800: '{gray.800}', 46 | 900: '{gray.900}', 47 | 950: '{gray.950}', 48 | }, 49 | }, 50 | }, 51 | }, 52 | }); 53 | 54 | export default customThemePreset; 55 | -------------------------------------------------------------------------------- /resources/js/theme/enterprise-preset.js: -------------------------------------------------------------------------------- 1 | import Preset from '@primeuix/themes/material'; 2 | import { definePreset } from '@primeuix/themes'; 3 | 4 | const customThemePreset = definePreset(Preset, { 5 | semantic: { 6 | primary: { 7 | 50: '{teal.50}', 8 | 100: '{teal.100}', 9 | 200: '{teal.200}', 10 | 300: '{teal.300}', 11 | 400: '{teal.400}', 12 | 500: '{teal.500}', 13 | 600: '{teal.600}', 14 | 700: '{teal.700}', 15 | 800: '{teal.800}', 16 | 900: '{teal.900}', 17 | 950: '{teal.950}', 18 | }, 19 | colorScheme: { 20 | light: { 21 | surface: { 22 | 50: '{neutral.50}', 23 | 100: '{neutral.100}', 24 | 200: '{neutral.200}', 25 | 300: '{neutral.300}', 26 | 400: '{neutral.400}', 27 | 500: '{neutral.500}', 28 | 600: '{neutral.600}', 29 | 700: '{neutral.700}', 30 | 800: '{neutral.800}', 31 | 900: '{neutral.900}', 32 | 950: '{neutral.950}', 33 | }, 34 | }, 35 | dark: { 36 | surface: { 37 | 50: '{neutral.50}', 38 | 100: '{neutral.100}', 39 | 200: '{neutral.200}', 40 | 300: '{neutral.300}', 41 | 400: '{neutral.400}', 42 | 500: '{neutral.500}', 43 | 600: '{neutral.600}', 44 | 700: '{neutral.700}', 45 | 800: '{neutral.800}', 46 | 900: '{neutral.900}', 47 | 950: '{neutral.950}', 48 | }, 49 | }, 50 | }, 51 | }, 52 | }); 53 | 54 | export default customThemePreset; 55 | -------------------------------------------------------------------------------- /resources/js/theme/noir-preset.js: -------------------------------------------------------------------------------- 1 | import Preset from '@primeuix/themes/aura'; 2 | import { definePreset } from '@primeuix/themes'; 3 | 4 | // https://primevue.org/theming/styled/#noir 5 | const customThemePreset = definePreset(Preset, { 6 | semantic: { 7 | primary: { 8 | 50: '{zinc.50}', 9 | 100: '{zinc.100}', 10 | 200: '{zinc.200}', 11 | 300: '{zinc.300}', 12 | 400: '{zinc.400}', 13 | 500: '{zinc.500}', 14 | 600: '{zinc.600}', 15 | 700: '{zinc.700}', 16 | 800: '{zinc.800}', 17 | 900: '{zinc.900}', 18 | 950: '{zinc.950}', 19 | }, 20 | colorScheme: { 21 | light: { 22 | primary: { 23 | color: '{zinc.950}', 24 | inverseColor: '#ffffff', 25 | hoverColor: '{zinc.900}', 26 | activeColor: '{zinc.800}', 27 | }, 28 | highlight: { 29 | background: '{zinc.950}', 30 | focusBackground: '{zinc.700}', 31 | color: '#ffffff', 32 | focusColor: '#ffffff', 33 | }, 34 | }, 35 | dark: { 36 | primary: { 37 | color: '{zinc.50}', 38 | inverseColor: '{zinc.950}', 39 | hoverColor: '{zinc.100}', 40 | activeColor: '{zinc.200}', 41 | }, 42 | highlight: { 43 | background: 'rgba(250, 250, 250, .16)', 44 | focusBackground: 'rgba(250, 250, 250, .24)', 45 | color: 'rgba(255,255,255,.87)', 46 | focusColor: 'rgba(255,255,255,.87)', 47 | }, 48 | }, 49 | }, 50 | }, 51 | }); 52 | 53 | export default customThemePreset; 54 | -------------------------------------------------------------------------------- /resources/js/theme/warm-preset.js: -------------------------------------------------------------------------------- 1 | import Preset from '@primeuix/themes/nora'; 2 | import { definePreset } from '@primeuix/themes'; 3 | 4 | const customThemePreset = definePreset(Preset, { 5 | semantic: { 6 | primary: { 7 | 50: '{orange.50}', 8 | 100: '{orange.100}', 9 | 200: '{orange.200}', 10 | 300: '{orange.300}', 11 | 400: '{orange.400}', 12 | 500: '{orange.500}', 13 | 600: '{orange.600}', 14 | 700: '{orange.700}', 15 | 800: '{orange.800}', 16 | 900: '{orange.900}', 17 | 950: '{orange.950}', 18 | }, 19 | colorScheme: { 20 | light: { 21 | surface: { 22 | 50: '{stone.50}', 23 | 100: '{stone.100}', 24 | 200: '{stone.200}', 25 | 300: '{stone.300}', 26 | 400: '{stone.400}', 27 | 500: '{stone.500}', 28 | 600: '{stone.600}', 29 | 700: '{stone.700}', 30 | 800: '{stone.800}', 31 | 900: '{stone.900}', 32 | 950: '{stone.950}', 33 | }, 34 | }, 35 | dark: { 36 | surface: { 37 | 50: '{stone.50}', 38 | 100: '{stone.100}', 39 | 200: '{stone.200}', 40 | 300: '{stone.300}', 41 | 400: '{stone.400}', 42 | 500: '{stone.500}', 43 | 600: '{stone.600}', 44 | 700: '{stone.700}', 45 | 800: '{stone.800}', 46 | 900: '{stone.900}', 47 | 950: '{stone.950}', 48 | }, 49 | }, 50 | }, 51 | }, 52 | }); 53 | 54 | export default customThemePreset; 55 | -------------------------------------------------------------------------------- /resources/js/types/global.d.ts: -------------------------------------------------------------------------------- 1 | import { PageProps as InertiaPageProps } from '@inertiajs/core'; 2 | import { AxiosInstance } from 'axios'; 3 | import { route as ziggyRoute } from 'ziggy-js'; 4 | import { PageProps as AppPageProps } from './'; 5 | 6 | declare global { 7 | interface Window { 8 | axios: AxiosInstance; 9 | } 10 | 11 | /* eslint-disable no-var */ 12 | var route: typeof ziggyRoute; 13 | } 14 | 15 | declare module 'vue' { 16 | interface ComponentCustomProperties { 17 | route: typeof ziggyRoute; 18 | } 19 | } 20 | 21 | declare module '@inertiajs/core' { 22 | interface PageProps extends InertiaPageProps, AppPageProps {} 23 | } 24 | -------------------------------------------------------------------------------- /resources/js/types/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { DataTableFilterMetaData } from 'primevue'; 2 | import type { Page, PageProps, Errors } from '@inertiajs/core'; 3 | import type { MenuItem as PrimeVueMenuItem } from 'primevue/menuitem'; 4 | import type { LucideIcon } from 'lucide-vue-next'; 5 | 6 | export interface User { 7 | id: number; 8 | name: string; 9 | email: string; 10 | email_verified_at?: string; 11 | } 12 | 13 | export type PageProps< 14 | T extends Record = Record 15 | > = T; 16 | 17 | export type PrimeVueDataFilters = { 18 | [key: string]: DataTableFilterMetaData; 19 | }; 20 | 21 | export interface MenuItem extends PrimeVueMenuItem { 22 | route?: string; 23 | lucideIcon?: LucideIcon; 24 | active?: boolean; 25 | } 26 | 27 | export interface InertiaRouterFetchCallbacks { 28 | onSuccess?: (page: Page) => void; 29 | onError?: (errors: Errors) => void; 30 | onFinish?: () => void; 31 | } 32 | -------------------------------------------------------------------------------- /resources/js/types/paginiation.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface representing a pagination link. 3 | */ 4 | export interface PaginationLink { 5 | url: string | null; 6 | label: string; 7 | active: boolean; 8 | } 9 | 10 | /** 11 | * Interface representing pagination metadata. 12 | */ 13 | export interface PaginationMeta { 14 | current_page: number; 15 | from: number | null; 16 | last_page: number; 17 | path: string; 18 | per_page: number; 19 | to: number | null; 20 | total: number; 21 | } 22 | 23 | /** 24 | * Interface representing a Laravel Illuminate\Pagination\LengthAwarePaginator 25 | * @template T - The type of items in the paginator. 26 | */ 27 | export interface LengthAwarePaginator { 28 | current_page: number; 29 | data: T[]; 30 | first_page_url: string; 31 | from: number | null; 32 | total: number; 33 | per_page: number; 34 | last_page: number; 35 | last_page_url: string; 36 | next_page_url: string | null; 37 | path: string; 38 | to: number | null; 39 | prev_page_url: string | null; 40 | links?: PaginationLink[]; 41 | meta?: PaginationMeta; 42 | } 43 | -------------------------------------------------------------------------------- /resources/js/utils.ts: -------------------------------------------------------------------------------- 1 | import { twMerge } from 'tailwind-merge'; 2 | import { mergeProps } from 'vue'; 3 | 4 | export const ptViewMerge = ( 5 | globalPTProps = {} as any, 6 | selfPTProps = {} as any, 7 | datasets: any 8 | ) => { 9 | const { class: globalClass, ...globalRest } = globalPTProps; 10 | const { class: selfClass, ...selfRest } = selfPTProps; 11 | 12 | return mergeProps( 13 | { class: twMerge(globalClass, selfClass) }, 14 | globalRest, 15 | selfRest, 16 | datasets 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /resources/views/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | {{ config('app.name', 'Laravel') }} 12 | 13 | 14 | 18 | 22 | 23 | 24 | @routes 25 | @vite(['resources/js/app.js']) 26 | @inertiaHead 27 | 28 | 29 | 30 | @inertia 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /routes/auth.php: -------------------------------------------------------------------------------- 1 | group(function () { 14 | Route::get('register', [RegisteredUserController::class, 'create']) 15 | ->name('register'); 16 | Route::post('register', [RegisteredUserController::class, 'store']); 17 | Route::get('login', [AuthenticatedSessionController::class, 'create']) 18 | ->name('login'); 19 | Route::post('login', [AuthenticatedSessionController::class, 'store']); 20 | Route::get('forgot-password', [PasswordResetLinkController::class, 'create']) 21 | ->name('password.request'); 22 | Route::post('forgot-password', [PasswordResetLinkController::class, 'store']) 23 | ->name('password.email'); 24 | Route::get('reset-password/{token}', [NewPasswordController::class, 'create']) 25 | ->name('password.reset'); 26 | Route::post('reset-password', [NewPasswordController::class, 'store']) 27 | ->name('password.store'); 28 | }); 29 | 30 | Route::middleware('auth')->group(function () { 31 | Route::get('verify-email', EmailVerificationPromptController::class) 32 | ->name('verification.notice'); 33 | Route::get('verify-email/{id}/{hash}', VerifyEmailController::class) 34 | ->middleware(['signed', 'throttle:6,1']) 35 | ->name('verification.verify'); 36 | Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store']) 37 | ->middleware('throttle:6,1') 38 | ->name('verification.send'); 39 | Route::get('confirm-password', [ConfirmablePasswordController::class, 'show']) 40 | ->name('password.confirm'); 41 | Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']); 42 | Route::post('logout', [AuthenticatedSessionController::class, 'destroy']) 43 | ->name('logout'); 44 | }); 45 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /routes/settings.php: -------------------------------------------------------------------------------- 1 | group(function () { 9 | Route::redirect('settings', '/settings/profile'); 10 | 11 | Route::get('settings/profile', [ProfileController::class, 'edit'])->name('profile.edit'); 12 | Route::patch('settings/profile', [ProfileController::class, 'update'])->name('profile.update'); 13 | Route::delete('settings/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); 14 | 15 | Route::get('settings/password', [PasswordController::class, 'edit'])->name('password.edit'); 16 | Route::put('settings/password', [PasswordController::class, 'update'])->name('password.update'); 17 | 18 | Route::get('settings/appearance', function () { 19 | return Inertia::render('settings/Appearance'); 20 | })->name('appearance'); 21 | }); 22 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | Application::VERSION, 10 | 'phpVersion' => PHP_VERSION, 11 | ]); 12 | })->name('welcome'); 13 | 14 | Route::get('/dashboard', function () { 15 | return Inertia::render('Dashboard'); 16 | })->middleware(['auth', 'verified'])->name('dashboard'); 17 | 18 | require __DIR__ . '/settings.php'; 19 | require __DIR__ . '/auth.php'; 20 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.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 | -------------------------------------------------------------------------------- /storage/pail/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/Feature/Auth/AuthenticationTest.php: -------------------------------------------------------------------------------- 1 | get('/login'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | 20 | public function test_users_can_authenticate_using_the_login_screen(): void 21 | { 22 | $user = User::factory()->create(); 23 | 24 | $response = $this->post('/login', [ 25 | 'email' => $user->email, 26 | 'password' => 'password', 27 | ]); 28 | 29 | $this->assertAuthenticated(); 30 | $response->assertRedirect(route('dashboard', absolute: false)); 31 | } 32 | 33 | public function test_users_can_not_authenticate_with_invalid_password(): void 34 | { 35 | $user = User::factory()->create(); 36 | 37 | $this->post('/login', [ 38 | 'email' => $user->email, 39 | 'password' => 'wrong-password', 40 | ]); 41 | 42 | $this->assertGuest(); 43 | } 44 | 45 | public function test_users_can_logout(): void 46 | { 47 | $user = User::factory()->create(); 48 | 49 | $response = $this->actingAs($user)->post('/logout'); 50 | 51 | $this->assertGuest(); 52 | $response->assertRedirect('/'); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tests/Feature/Auth/EmailVerificationTest.php: -------------------------------------------------------------------------------- 1 | unverified()->create(); 21 | 22 | $response = $this->actingAs($user)->get('/verify-email'); 23 | 24 | $response->assertStatus(200); 25 | } 26 | 27 | public function test_email_can_be_verified(): void 28 | { 29 | $user = User::factory()->unverified()->create(); 30 | $userRef = new ReflectionClass(User::class); 31 | if (!$userRef->implementsInterface(MustVerifyEmail::class)) { 32 | $this->markTestSkipped('User email verification is not enabled, skipping test.'); 33 | } 34 | 35 | Event::fake(); 36 | 37 | $verificationUrl = URL::temporarySignedRoute( 38 | 'verification.verify', 39 | now()->addMinutes(60), 40 | ['id' => $user->id, 'hash' => sha1($user->email)] 41 | ); 42 | 43 | $response = $this->actingAs($user)->get($verificationUrl); 44 | 45 | Event::assertDispatched(Verified::class); 46 | $this->assertTrue($user->fresh()->hasVerifiedEmail()); 47 | $response->assertRedirect(route('dashboard', absolute: false) . '?verified=1'); 48 | } 49 | 50 | public function test_email_is_not_verified_with_invalid_hash(): void 51 | { 52 | $user = User::factory()->unverified()->create(); 53 | 54 | $verificationUrl = URL::temporarySignedRoute( 55 | 'verification.verify', 56 | now()->addMinutes(60), 57 | ['id' => $user->id, 'hash' => sha1('wrong-email')] 58 | ); 59 | 60 | $this->actingAs($user)->get($verificationUrl); 61 | 62 | $this->assertFalse($user->fresh()->hasVerifiedEmail()); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /tests/Feature/Auth/PasswordConfirmationTest.php: -------------------------------------------------------------------------------- 1 | create(); 16 | 17 | $response = $this->actingAs($user)->get('/confirm-password'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | 22 | public function test_password_can_be_confirmed(): void 23 | { 24 | $user = User::factory()->create(); 25 | 26 | $response = $this->actingAs($user)->post('/confirm-password', [ 27 | 'password' => 'password', 28 | ]); 29 | 30 | $response->assertRedirect(); 31 | $response->assertSessionHasNoErrors(); 32 | } 33 | 34 | public function test_password_is_not_confirmed_with_invalid_password(): void 35 | { 36 | $user = User::factory()->create(); 37 | 38 | $response = $this->actingAs($user)->post('/confirm-password', [ 39 | 'password' => 'wrong-password', 40 | ]); 41 | 42 | $response->assertSessionHasErrors(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/Feature/Auth/PasswordResetTest.php: -------------------------------------------------------------------------------- 1 | get('/forgot-password'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | 22 | public function test_reset_password_link_can_be_requested(): void 23 | { 24 | Notification::fake(); 25 | 26 | $user = User::factory()->create(); 27 | 28 | $this->post('/forgot-password', ['email' => $user->email]); 29 | 30 | Notification::assertSentTo($user, ResetPassword::class); 31 | } 32 | 33 | public function test_reset_password_screen_can_be_rendered(): void 34 | { 35 | Notification::fake(); 36 | 37 | $user = User::factory()->create(); 38 | 39 | $this->post('/forgot-password', ['email' => $user->email]); 40 | 41 | Notification::assertSentTo($user, ResetPassword::class, function ($notification) { 42 | $response = $this->get('/reset-password/' . $notification->token); 43 | 44 | $response->assertStatus(200); 45 | 46 | return true; 47 | }); 48 | } 49 | 50 | public function test_password_can_be_reset_with_valid_token(): void 51 | { 52 | Notification::fake(); 53 | 54 | $user = User::factory()->create(); 55 | 56 | $this->post('/forgot-password', ['email' => $user->email]); 57 | 58 | Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) { 59 | $response = $this->post('/reset-password', [ 60 | 'token' => $notification->token, 61 | 'email' => $user->email, 62 | 'password' => 'password', 63 | 'password_confirmation' => 'password', 64 | ]); 65 | 66 | $response 67 | ->assertSessionHasNoErrors() 68 | ->assertRedirect(route('login')); 69 | 70 | return true; 71 | }); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /tests/Feature/Auth/RegistrationTest.php: -------------------------------------------------------------------------------- 1 | get('/register'); 15 | 16 | $response->assertStatus(200); 17 | } 18 | 19 | public function test_new_users_can_register(): void 20 | { 21 | $response = $this->post('/register', [ 22 | 'name' => 'Test User', 23 | 'email' => 'test@example.com', 24 | 'password' => 'password', 25 | 'password_confirmation' => 'password', 26 | ]); 27 | 28 | $this->assertAuthenticated(); 29 | $response->assertRedirect(route('dashboard', absolute: false)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/Feature/Settings/PasswordUpdateTest.php: -------------------------------------------------------------------------------- 1 | create(); 17 | 18 | $response = $this 19 | ->actingAs($user) 20 | ->from('/settings/password') 21 | ->put('/settings/password', [ 22 | 'current_password' => 'password', 23 | 'password' => 'new-password', 24 | 'password_confirmation' => 'new-password', 25 | ]); 26 | 27 | $response 28 | ->assertSessionHasNoErrors() 29 | ->assertRedirect('/settings/password'); 30 | 31 | $this->assertTrue(Hash::check('new-password', $user->refresh()->password)); 32 | } 33 | 34 | public function test_correct_password_must_be_provided_to_update_password() 35 | { 36 | $user = User::factory()->create(); 37 | 38 | $response = $this 39 | ->actingAs($user) 40 | ->from('/settings/password') 41 | ->put('/settings/password', [ 42 | 'current_password' => 'wrong-password', 43 | 'password' => 'new-password', 44 | 'password_confirmation' => 'new-password', 45 | ]); 46 | 47 | $response 48 | ->assertSessionHasErrors('current_password') 49 | ->assertRedirect('/settings/password'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /tests/Feature/Settings/ProfileUpdateTest.php: -------------------------------------------------------------------------------- 1 | create(); 16 | 17 | $response = $this 18 | ->actingAs($user) 19 | ->get('/settings/profile'); 20 | 21 | $response->assertOk(); 22 | } 23 | 24 | public function test_profile_information_can_be_updated() 25 | { 26 | $user = User::factory()->create(); 27 | 28 | $response = $this 29 | ->actingAs($user) 30 | ->patch('/settings/profile', [ 31 | 'name' => 'Test User', 32 | 'email' => 'test@example.com', 33 | ]); 34 | 35 | $response 36 | ->assertSessionHasNoErrors() 37 | ->assertRedirect('/settings/profile'); 38 | 39 | $user->refresh(); 40 | 41 | $this->assertSame('Test User', $user->name); 42 | $this->assertSame('test@example.com', $user->email); 43 | $this->assertNull($user->email_verified_at); 44 | } 45 | 46 | public function test_email_verification_status_is_unchanged_when_the_email_address_is_unchanged() 47 | { 48 | $user = User::factory()->create(); 49 | 50 | $response = $this 51 | ->actingAs($user) 52 | ->patch('/settings/profile', [ 53 | 'name' => 'Test User', 54 | 'email' => $user->email, 55 | ]); 56 | 57 | $response 58 | ->assertSessionHasNoErrors() 59 | ->assertRedirect('/settings/profile'); 60 | 61 | $this->assertNotNull($user->refresh()->email_verified_at); 62 | } 63 | 64 | public function test_user_can_delete_their_account() 65 | { 66 | $user = User::factory()->create(); 67 | 68 | $response = $this 69 | ->actingAs($user) 70 | ->delete('/settings/profile', [ 71 | 'password' => 'password', 72 | ]); 73 | 74 | $response 75 | ->assertSessionHasNoErrors() 76 | ->assertRedirect('/'); 77 | 78 | $this->assertGuest(); 79 | $this->assertNull($user->fresh()); 80 | } 81 | 82 | public function test_correct_password_must_be_provided_to_delete_account() 83 | { 84 | $user = User::factory()->create(); 85 | 86 | $response = $this 87 | ->actingAs($user) 88 | ->from('/settings/profile') 89 | ->delete('/settings/profile', [ 90 | 'password' => 'wrong-password', 91 | ]); 92 | 93 | $response 94 | ->assertSessionHasErrors('password') 95 | ->assertRedirect('/settings/profile'); 96 | 97 | $this->assertNotNull($user->fresh()); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "allowImportingTsExtensions": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "strict": true, 8 | "isolatedModules": true, 9 | "target": "ESNext", 10 | "esModuleInterop": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "noEmit": true, 13 | "skipLibCheck": true, 14 | "paths": { 15 | "@/*": [ 16 | "./resources/js/*" 17 | ], 18 | "ziggy-js": [ 19 | "./vendor/tightenco/ziggy" 20 | ] 21 | } 22 | }, 23 | "include": [ 24 | "resources/js/**/*.ts", 25 | "resources/js/**/*.d.ts", 26 | "resources/js/**/*.vue" 27 | ], 28 | "exclude": [ 29 | "node_modules", 30 | "public" 31 | ] 32 | } -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig, loadEnv } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | import vue from '@vitejs/plugin-vue'; 4 | import tailwindcss from "@tailwindcss/vite"; 5 | import Components from 'unplugin-vue-components/vite'; 6 | import { PrimeVueResolver } from '@primevue/auto-import-resolver'; 7 | 8 | // https://vitejs.dev/config/ 9 | export default ({ mode }) => { 10 | const env = loadEnv(mode, process.cwd()); 11 | const devPort = parseInt(env.VITE_PORT) || 5173; 12 | const hostDomain = env.VITE_HOST_DOMAIN || 'localhost'; 13 | 14 | return defineConfig({ 15 | plugins: [ 16 | laravel({ 17 | input: 'resources/js/app.js', 18 | ssr: 'resources/js/ssr.js', 19 | refresh: true, 20 | }), 21 | vue({ 22 | template: { 23 | transformAssetUrls: { 24 | base: null, 25 | includeAbsolute: false, 26 | }, 27 | }, 28 | }), 29 | tailwindcss(), 30 | Components({ 31 | resolvers: [PrimeVueResolver()], 32 | }), 33 | ], 34 | server: { 35 | port: devPort, 36 | host: true, 37 | hmr: { 38 | host: hostDomain, 39 | }, 40 | cors: true, 41 | watch: { 42 | usePolling: true, 43 | }, 44 | }, 45 | preview: { 46 | port: devPort, 47 | }, 48 | }); 49 | }; 50 | --------------------------------------------------------------------------------