├── .editorconfig ├── .env.example ├── .gitattributes ├── .github └── workflows │ ├── lint.yml │ └── tests.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── 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 │ │ ├── HandleAppearance.php │ │ └── HandleInertiaRequests.php │ └── Requests │ │ ├── Auth │ │ └── LoginRequest.php │ │ └── Settings │ │ └── ProfileUpdateRequest.php ├── Models │ └── User.php └── Providers │ └── AppServiceProvider.php ├── artisan ├── bootstrap ├── app.php ├── cache │ └── .gitignore └── providers.php ├── components.json ├── composer.json ├── 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 ├── eslint.config.js ├── package-lock.json ├── package.json ├── phpstan.neon ├── phpunit.xml ├── pint.json ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── rector.php ├── resources ├── css │ └── app.css ├── js │ ├── app.ts │ ├── components │ │ ├── AppContent.vue │ │ ├── AppHeader.vue │ │ ├── AppLogo.vue │ │ ├── AppLogoIcon.vue │ │ ├── AppShell.vue │ │ ├── AppSidebar.vue │ │ ├── AppSidebarHeader.vue │ │ ├── AppearanceTabs.vue │ │ ├── Breadcrumbs.vue │ │ ├── DeleteUser.vue │ │ ├── Heading.vue │ │ ├── HeadingSmall.vue │ │ ├── Icon.vue │ │ ├── InputError.vue │ │ ├── NavFooter.vue │ │ ├── NavMain.vue │ │ ├── NavUser.vue │ │ ├── PlaceholderPattern.vue │ │ ├── TextLink.vue │ │ ├── UserInfo.vue │ │ ├── UserMenuContent.vue │ │ └── ui │ │ │ ├── avatar │ │ │ ├── Avatar.vue │ │ │ ├── AvatarFallback.vue │ │ │ ├── AvatarImage.vue │ │ │ └── index.ts │ │ │ ├── breadcrumb │ │ │ ├── Breadcrumb.vue │ │ │ ├── BreadcrumbEllipsis.vue │ │ │ ├── BreadcrumbItem.vue │ │ │ ├── BreadcrumbLink.vue │ │ │ ├── BreadcrumbList.vue │ │ │ ├── BreadcrumbPage.vue │ │ │ ├── BreadcrumbSeparator.vue │ │ │ └── index.ts │ │ │ ├── button │ │ │ ├── Button.vue │ │ │ └── index.ts │ │ │ ├── card │ │ │ ├── Card.vue │ │ │ ├── CardContent.vue │ │ │ ├── CardDescription.vue │ │ │ ├── CardFooter.vue │ │ │ ├── CardHeader.vue │ │ │ ├── CardTitle.vue │ │ │ └── index.ts │ │ │ ├── checkbox │ │ │ ├── Checkbox.vue │ │ │ └── index.ts │ │ │ ├── collapsible │ │ │ ├── Collapsible.vue │ │ │ ├── CollapsibleContent.vue │ │ │ ├── CollapsibleTrigger.vue │ │ │ └── index.ts │ │ │ ├── dialog │ │ │ ├── Dialog.vue │ │ │ ├── DialogClose.vue │ │ │ ├── DialogContent.vue │ │ │ ├── DialogDescription.vue │ │ │ ├── DialogFooter.vue │ │ │ ├── DialogHeader.vue │ │ │ ├── DialogScrollContent.vue │ │ │ ├── DialogTitle.vue │ │ │ ├── DialogTrigger.vue │ │ │ └── index.ts │ │ │ ├── dropdown-menu │ │ │ ├── DropdownMenu.vue │ │ │ ├── DropdownMenuCheckboxItem.vue │ │ │ ├── DropdownMenuContent.vue │ │ │ ├── DropdownMenuGroup.vue │ │ │ ├── DropdownMenuItem.vue │ │ │ ├── DropdownMenuLabel.vue │ │ │ ├── DropdownMenuRadioGroup.vue │ │ │ ├── DropdownMenuRadioItem.vue │ │ │ ├── DropdownMenuSeparator.vue │ │ │ ├── DropdownMenuShortcut.vue │ │ │ ├── DropdownMenuSub.vue │ │ │ ├── DropdownMenuSubContent.vue │ │ │ ├── DropdownMenuSubTrigger.vue │ │ │ ├── DropdownMenuTrigger.vue │ │ │ └── index.ts │ │ │ ├── input │ │ │ ├── Input.vue │ │ │ └── index.ts │ │ │ ├── label │ │ │ ├── Label.vue │ │ │ └── index.ts │ │ │ ├── navigation-menu │ │ │ ├── NavigationMenu.vue │ │ │ ├── NavigationMenuContent.vue │ │ │ ├── NavigationMenuIndicator.vue │ │ │ ├── NavigationMenuItem.vue │ │ │ ├── NavigationMenuLink.vue │ │ │ ├── NavigationMenuList.vue │ │ │ ├── NavigationMenuTrigger.vue │ │ │ ├── NavigationMenuViewport.vue │ │ │ └── index.ts │ │ │ ├── separator │ │ │ ├── Separator.vue │ │ │ └── index.ts │ │ │ ├── sheet │ │ │ ├── Sheet.vue │ │ │ ├── SheetClose.vue │ │ │ ├── SheetContent.vue │ │ │ ├── SheetDescription.vue │ │ │ ├── SheetFooter.vue │ │ │ ├── SheetHeader.vue │ │ │ ├── SheetTitle.vue │ │ │ ├── SheetTrigger.vue │ │ │ └── index.ts │ │ │ ├── sidebar │ │ │ ├── Sidebar.vue │ │ │ ├── SidebarContent.vue │ │ │ ├── SidebarFooter.vue │ │ │ ├── SidebarGroup.vue │ │ │ ├── SidebarGroupAction.vue │ │ │ ├── SidebarGroupContent.vue │ │ │ ├── SidebarGroupLabel.vue │ │ │ ├── SidebarHeader.vue │ │ │ ├── SidebarInput.vue │ │ │ ├── SidebarInset.vue │ │ │ ├── SidebarMenu.vue │ │ │ ├── SidebarMenuAction.vue │ │ │ ├── SidebarMenuBadge.vue │ │ │ ├── SidebarMenuButton.vue │ │ │ ├── SidebarMenuButtonChild.vue │ │ │ ├── SidebarMenuItem.vue │ │ │ ├── SidebarMenuSkeleton.vue │ │ │ ├── SidebarMenuSub.vue │ │ │ ├── SidebarMenuSubButton.vue │ │ │ ├── SidebarMenuSubItem.vue │ │ │ ├── SidebarProvider.vue │ │ │ ├── SidebarRail.vue │ │ │ ├── SidebarSeparator.vue │ │ │ ├── SidebarTrigger.vue │ │ │ ├── index.ts │ │ │ └── utils.ts │ │ │ ├── skeleton │ │ │ ├── Skeleton.vue │ │ │ └── index.ts │ │ │ └── tooltip │ │ │ ├── Tooltip.vue │ │ │ ├── TooltipContent.vue │ │ │ ├── TooltipProvider.vue │ │ │ ├── TooltipTrigger.vue │ │ │ └── index.ts │ ├── composables │ │ ├── useAppearance.ts │ │ └── useInitials.ts │ ├── layouts │ │ ├── AppLayout.vue │ │ ├── AuthLayout.vue │ │ ├── app │ │ │ ├── AppHeaderLayout.vue │ │ │ └── AppSidebarLayout.vue │ │ ├── auth │ │ │ ├── AuthCardLayout.vue │ │ │ ├── AuthSimpleLayout.vue │ │ │ └── AuthSplitLayout.vue │ │ └── settings │ │ │ └── Layout.vue │ ├── lib │ │ └── utils.ts │ ├── pages │ │ ├── Dashboard.vue │ │ ├── Welcome.vue │ │ ├── auth │ │ │ ├── ConfirmPassword.vue │ │ │ ├── ForgotPassword.vue │ │ │ ├── Login.vue │ │ │ ├── Register.vue │ │ │ ├── ResetPassword.vue │ │ │ └── VerifyEmail.vue │ │ └── settings │ │ │ ├── Appearance.vue │ │ │ ├── Password.vue │ │ │ └── Profile.vue │ ├── ssr.ts │ └── types │ │ ├── globals.d.ts │ │ ├── index.d.ts │ │ └── ziggy.d.ts └── views │ └── app.blade.php ├── routes ├── auth.php ├── console.php ├── settings.php └── web.php ├── storage ├── app │ ├── .gitignore │ ├── private │ │ └── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── Feature │ ├── Auth │ │ ├── AuthenticationTest.php │ │ ├── EmailVerificationTest.php │ │ ├── PasswordConfirmationTest.php │ │ ├── PasswordResetTest.php │ │ └── RegistrationTest.php │ ├── DashboardTest.php │ ├── ExampleTest.php │ └── Settings │ │ ├── PasswordUpdateTest.php │ │ └── ProfileUpdateTest.php ├── Pest.php ├── TestCase.php └── Unit │ ├── ArchTest.php │ └── ExampleTest.php ├── tsconfig.json └── vite.config.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | APP_LOCALE=en 8 | APP_FALLBACK_LOCALE=en 9 | APP_FAKER_LOCALE=en_US 10 | 11 | APP_MAINTENANCE_DRIVER=file 12 | # APP_MAINTENANCE_STORE=database 13 | 14 | PHP_CLI_SERVER_WORKERS=4 15 | 16 | BCRYPT_ROUNDS=12 17 | 18 | LOG_CHANNEL=stack 19 | LOG_STACK=single 20 | LOG_DEPRECATIONS_CHANNEL=null 21 | LOG_LEVEL=debug 22 | 23 | DB_CONNECTION=sqlite 24 | # DB_HOST=127.0.0.1 25 | # DB_PORT=3306 26 | # DB_DATABASE=laravel 27 | # DB_USERNAME=root 28 | # DB_PASSWORD= 29 | 30 | SESSION_DRIVER=database 31 | SESSION_LIFETIME=120 32 | SESSION_ENCRYPT=false 33 | SESSION_PATH=/ 34 | SESSION_DOMAIN=null 35 | 36 | BROADCAST_CONNECTION=log 37 | FILESYSTEM_DISK=local 38 | QUEUE_CONNECTION=database 39 | 40 | CACHE_STORE=database 41 | # CACHE_PREFIX= 42 | 43 | MEMCACHED_HOST=127.0.0.1 44 | 45 | REDIS_CLIENT=phpredis 46 | REDIS_HOST=127.0.0.1 47 | REDIS_PASSWORD=null 48 | REDIS_PORT=6379 49 | 50 | MAIL_MAILER=log 51 | MAIL_SCHEME=null 52 | MAIL_HOST=127.0.0.1 53 | MAIL_PORT=2525 54 | MAIL_USERNAME=null 55 | MAIL_PASSWORD=null 56 | MAIL_FROM_ADDRESS="hello@example.com" 57 | MAIL_FROM_NAME="${APP_NAME}" 58 | 59 | AWS_ACCESS_KEY_ID= 60 | AWS_SECRET_ACCESS_KEY= 61 | AWS_DEFAULT_REGION=us-east-1 62 | AWS_BUCKET= 63 | AWS_USE_PATH_STYLE_ENDPOINT=false 64 | 65 | VITE_APP_NAME="${APP_NAME}" 66 | -------------------------------------------------------------------------------- /.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 | CHANGELOG.md export-ignore 10 | README.md export-ignore 11 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: linter 2 | 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | - main 8 | pull_request: 9 | branches: 10 | - develop 11 | - main 12 | 13 | permissions: 14 | contents: write 15 | 16 | jobs: 17 | quality: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v4 21 | 22 | - name: Setup PHP 23 | uses: shivammathur/setup-php@v2 24 | with: 25 | php-version: '8.4' 26 | 27 | - name: Install Dependencies 28 | run: | 29 | composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist 30 | npm install 31 | 32 | - name: Run Pint 33 | run: vendor/bin/pint 34 | 35 | - name: Format Frontend 36 | run: npm run format 37 | 38 | - name: Lint Frontend 39 | run: npm run lint 40 | 41 | # - name: Commit Changes 42 | # uses: stefanzweifel/git-auto-commit-action@v5 43 | # with: 44 | # commit_message: fix code style 45 | # commit_options: '--no-verify' 46 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | - main 8 | pull_request: 9 | branches: 10 | - develop 11 | - main 12 | 13 | jobs: 14 | ci: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v4 20 | 21 | - name: Setup PHP 22 | uses: shivammathur/setup-php@v2 23 | with: 24 | php-version: 8.4 25 | tools: composer:v2 26 | coverage: xdebug 27 | 28 | - name: Setup Node 29 | uses: actions/setup-node@v4 30 | with: 31 | node-version: '22' 32 | cache: 'npm' 33 | 34 | - name: Install Node Dependencies 35 | run: npm ci 36 | 37 | - name: Install Dependencies 38 | run: composer install --no-interaction --prefer-dist --optimize-autoloader 39 | 40 | - name: Copy Environment File 41 | run: cp .env.example .env 42 | 43 | - name: Generate Application Key 44 | run: php artisan key:generate 45 | 46 | - name: Publish Ziggy Configuration 47 | run: php artisan ziggy:generate 48 | 49 | - name: Build Assets 50 | run: npm run build 51 | 52 | - name: Tests 53 | run: ./vendor/bin/phpunit 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache 2 | /bootstrap/ssr 3 | /node_modules 4 | /public/build 5 | /public/hot 6 | /public/storage 7 | /storage/*.key 8 | /storage/pail 9 | /vendor 10 | .env 11 | .env.backup 12 | .env.production 13 | .phpactor.json 14 | .phpunit.result.cache 15 | Homestead.json 16 | Homestead.yaml 17 | npm-debug.log 18 | yarn-error.log 19 | /auth.json 20 | /.fleet 21 | /.idea 22 | /.nova 23 | /.vscode 24 | /.zed 25 | 26 | _ide_helper.php 27 | _ide_helper_models.php 28 | phpstorm.meta.php 29 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | resources/js/components/ui/* 2 | resources/js/ziggy.js 3 | resources/views/mail/* 4 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "singleAttributePerLine": false, 5 | "htmlWhitespaceSensitivity": "css", 6 | "printWidth": 150, 7 | "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"], 8 | "tailwindFunctions": ["clsx", "cn"], 9 | "tabWidth": 4, 10 | "overrides": [ 11 | { 12 | "files": "**/*.yml", 13 | "options": { 14 | "tabWidth": 2 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthenticatedSessionController.php: -------------------------------------------------------------------------------- 1 | Route::has('password.request'), 25 | 'status' => $request->session()->get('status'), 26 | ]); 27 | } 28 | 29 | /** 30 | * Handle an incoming authentication request. 31 | */ 32 | public function store(LoginRequest $request): RedirectResponse 33 | { 34 | $request->authenticate(); 35 | 36 | $request->session()->regenerate(); 37 | 38 | return redirect()->intended(route('dashboard', absolute: false)); 39 | } 40 | 41 | /** 42 | * Destroy an authenticated session. 43 | */ 44 | public function destroy(Request $request): RedirectResponse 45 | { 46 | Auth::guard('web')->logout(); 47 | 48 | $request->session()->invalidate(); 49 | $request->session()->regenerateToken(); 50 | 51 | return redirect('/'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ConfirmablePasswordController.php: -------------------------------------------------------------------------------- 1 | validate([ 31 | 'email' => $request->user()?->email, 32 | 'password' => $request->password, 33 | ]), ValidationException::withMessages([ 34 | 'password' => __('auth.password'), 35 | ])); 36 | 37 | $request->session()->put('auth.password_confirmed_at', time()); 38 | 39 | return redirect()->intended(route('dashboard', absolute: false)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationNotificationController.php: -------------------------------------------------------------------------------- 1 | user()?->hasVerifiedEmail()) { 19 | return redirect()->intended(route('dashboard', absolute: false)); 20 | } 21 | 22 | $request->user()?->sendEmailVerificationNotification(); 23 | 24 | return back()->with('status', 'verification-link-sent'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationPromptController.php: -------------------------------------------------------------------------------- 1 | user()?->hasVerifiedEmail() 21 | ? redirect()->intended(route('dashboard', absolute: false)) 22 | : Inertia::render('auth/VerifyEmail', ['status' => $request->session()->get('status')]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/NewPasswordController.php: -------------------------------------------------------------------------------- 1 | $request->email, 29 | 'token' => $request->route('token'), 30 | ]); 31 | } 32 | 33 | /** 34 | * Handle an incoming new password request. 35 | * 36 | * @throws ValidationException 37 | */ 38 | public function store(Request $request): RedirectResponse 39 | { 40 | $request->validate([ 41 | 'token' => 'required', 42 | 'email' => 'required|email', 43 | 'password' => ['required', 'confirmed', Rules\Password::defaults()], 44 | ]); 45 | 46 | // Here we will attempt to reset the user's password. If it is successful we 47 | // will update the password on an actual user model and persist it to the 48 | // database. Otherwise we will parse the error and return the response. 49 | /** @var Password::PASSWORD_RESET|Password::RESET_THROTTLED|Password::INVALID_USER|Password::INVALID_TOKEN $status */ 50 | $status = Password::reset( 51 | $request->only('email', 'password', 'password_confirmation', 'token'), 52 | function (User $user) use ($request): void { 53 | /** @var non-empty-string $password */ 54 | $password = $request->string('password'); 55 | $user->forceFill([ 56 | 'password' => Hash::make($password), 57 | 'remember_token' => Str::random(60), 58 | ])->save(); 59 | 60 | event(new PasswordReset($user)); 61 | } 62 | ); 63 | 64 | // If the password was successfully reset, we will redirect the user back to 65 | // the application's home authenticated view. If there is an error we can 66 | // redirect them back to where they came from with their error message. 67 | if ($status === Password::PasswordReset) { 68 | return to_route('login')->with('status', __($status)); 69 | } 70 | 71 | throw ValidationException::withMessages([ 72 | 'email' => [__($status)], 73 | ]); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordResetLinkController.php: -------------------------------------------------------------------------------- 1 | $request->session()->get('status'), 23 | ]); 24 | } 25 | 26 | /** 27 | * Handle an incoming password reset link request. 28 | * 29 | * @throws \Illuminate\Validation\ValidationException 30 | */ 31 | public function store(Request $request): RedirectResponse 32 | { 33 | $request->validate([ 34 | 'email' => 'required|email', 35 | ]); 36 | 37 | Password::sendResetLink( 38 | $request->only('email') 39 | ); 40 | 41 | return back()->with('status', __('A reset link will be sent if the account exists.')); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisteredUserController.php: -------------------------------------------------------------------------------- 1 | validate([ 36 | 'name' => 'required|string|max:255', 37 | 'email' => 'required|string|lowercase|email|max:255|unique:'.User::class, 38 | 'password' => ['required', 'confirmed', Rules\Password::defaults()], 39 | ]); 40 | 41 | $user = User::query()->create([ 42 | 'name' => $request->name, 43 | 'email' => $request->email, 44 | 'password' => Hash::make((string) $request->string('password')), 45 | ]); 46 | 47 | event(new Registered($user)); 48 | 49 | Auth::login($user); 50 | 51 | return to_route('dashboard'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerifyEmailController.php: -------------------------------------------------------------------------------- 1 | user()?->hasVerifiedEmail()) { 20 | return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); 21 | } 22 | 23 | if ($request->user()?->markEmailAsVerified()) { 24 | /** @var \Illuminate\Contracts\Auth\MustVerifyEmail $user */ 25 | $user = $request->user(); 26 | event(new Verified($user)); 27 | } 28 | 29 | return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | user(); 24 | 25 | return Inertia::render('settings/Password', [ 26 | 'mustVerifyEmail' => $user instanceof MustVerifyEmail, 27 | 'status' => $request->session()->get('status'), 28 | ]); 29 | } 30 | 31 | /** 32 | * Update the user's password. 33 | */ 34 | public function update(Request $request): RedirectResponse 35 | { 36 | /** @var array $validated */ 37 | $validated = $request->validate([ 38 | 'current_password' => ['required', 'current_password'], 39 | 'password' => ['required', Password::defaults(), 'confirmed'], 40 | ]); 41 | 42 | $request->user()?->update([ 43 | 'password' => Hash::make((string) $validated['password']), 44 | ]); 45 | 46 | return back(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Http/Controllers/Settings/ProfileController.php: -------------------------------------------------------------------------------- 1 | $request->user() instanceof MustVerifyEmail, 25 | 'status' => $request->session()->get('status'), 26 | ]); 27 | } 28 | 29 | /** 30 | * Update the user's profile information. 31 | */ 32 | public function update(ProfileUpdateRequest $request): RedirectResponse 33 | { 34 | $request->user()?->fill($request->validated()); 35 | 36 | if ($request->user()?->isDirty('email')) { 37 | $request->user()->email_verified_at = null; 38 | } 39 | 40 | $request->user()?->save(); 41 | 42 | return to_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('/'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/Http/Middleware/HandleAppearance.php: -------------------------------------------------------------------------------- 1 | cookie('appearance') ?? 'system'); 22 | 23 | return $next($request); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Http/Middleware/HandleInertiaRequests.php: -------------------------------------------------------------------------------- 1 | 40 | */ 41 | public function share(Request $request): array 42 | { 43 | /** @var string $quote */ 44 | $quote = Inspiring::quotes()->random(); 45 | /** 46 | * @var string $message 47 | * @var string $author 48 | */ 49 | [$message, $author] = str($quote)->explode('-'); 50 | 51 | /** @var array $data */ 52 | $data = [ 53 | ...parent::share($request), 54 | 'name' => Config::string('app.name'), 55 | 'quote' => ['message' => mb_trim($message), 'author' => mb_trim($author)], 56 | 'auth' => [ 57 | 'user' => $request->user(), 58 | ], 59 | 'ziggy' => [ 60 | ...(new Ziggy)->toArray(), 61 | 'location' => $request->url(), 62 | ], 63 | ]; 64 | 65 | return $data; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Requests/Auth/LoginRequest.php: -------------------------------------------------------------------------------- 1 | |string> 28 | */ 29 | public function rules(): array 30 | { 31 | return [ 32 | 'email' => ['required', 'string', 'email'], 33 | 'password' => ['required', 'string'], 34 | ]; 35 | } 36 | 37 | /** 38 | * Attempt to authenticate the request's credentials. 39 | * 40 | * @throws ValidationException 41 | */ 42 | public function authenticate(): void 43 | { 44 | $this->ensureIsNotRateLimited(); 45 | 46 | if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { 47 | RateLimiter::hit($this->throttleKey()); 48 | 49 | throw ValidationException::withMessages([ 50 | 'email' => trans('auth.failed'), 51 | ]); 52 | } 53 | 54 | RateLimiter::clear($this->throttleKey()); 55 | } 56 | 57 | /** 58 | * Ensure the login request is not rate limited. 59 | * 60 | * @throws ValidationException 61 | */ 62 | public function ensureIsNotRateLimited(): void 63 | { 64 | if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { 65 | return; 66 | } 67 | 68 | event(new Lockout($this)); 69 | 70 | $seconds = RateLimiter::availableIn($this->throttleKey()); 71 | 72 | throw ValidationException::withMessages([ 73 | 'email' => trans('auth.throttle', [ 74 | 'seconds' => $seconds, 75 | 'minutes' => ceil($seconds / 60), 76 | ]), 77 | ]); 78 | } 79 | 80 | /** 81 | * Get the rate limiting throttle key for the request. 82 | */ 83 | public function throttleKey(): string 84 | { 85 | return Str::transliterate(Str::lower((string) $this->string('email')).'|'.$this->ip()); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/Http/Requests/Settings/ProfileUpdateRequest.php: -------------------------------------------------------------------------------- 1 | |string> 17 | */ 18 | public function rules(): array 19 | { 20 | return [ 21 | 'name' => ['required', 'string', 'max:255'], 22 | 'email' => [ 23 | 'required', 24 | 'string', 25 | 'lowercase', 26 | 'email', 27 | 'max:255', 28 | Rule::unique(User::class)->ignore($this->user()?->id), 29 | ], 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureCommands(); 32 | $this->configureDates(); 33 | $this->configureModels(); 34 | $this->configureUrl(); 35 | $this->configureVite(); 36 | } 37 | 38 | /** 39 | * It's recommended to use CarbonImmutable as it's immutable and thread-safe to avoid issues with mutability. 40 | * 41 | * @see https://dyrynda.com.au/blog/laravel-immutable-dates 42 | */ 43 | private function configureDates(): void 44 | { 45 | Date::use(CarbonImmutable::class); 46 | } 47 | 48 | /** 49 | * Configure the application's commands. 50 | */ 51 | private function configureCommands(): void 52 | { 53 | DB::prohibitDestructiveCommands(App::isProduction()); 54 | } 55 | 56 | /** 57 | * Configure the application's models. 58 | * This is optional, but it's recommended to enable strict mode and disable mass assignment. 59 | * 60 | * @see https://laravel.com/docs/eloquent#configuring-eloquent-strictness 61 | */ 62 | private function configureModels(): void 63 | { 64 | Model::shouldBeStrict(); 65 | 66 | Model::unguard(); 67 | } 68 | 69 | /** 70 | * Configure the application's URL. 71 | * This is optional, but it's recommended to force HTTPS in production. 72 | * 73 | * @see https://laravel.com/docs/octane#serving-your-application-via-https 74 | */ 75 | private function configureUrl(): void 76 | { 77 | URL::forceHttps(App::isProduction()); 78 | } 79 | 80 | /** 81 | * Configure the application's Vite loading strategy. 82 | * This is optional, but it's recommended to use aggressive prefetching so the UI feels snappy. 83 | */ 84 | private function configureVite(): void 85 | { 86 | Vite::useAggressivePrefetching(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | handleCommand(new ArgvInput); 17 | 18 | exit($status); 19 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 14 | web: __DIR__.'/../routes/web.php', 15 | commands: __DIR__.'/../routes/console.php', 16 | health: '/up', 17 | ) 18 | ->withMiddleware(function (Middleware $middleware): void { 19 | $middleware->encryptCookies(except: ['appearance']); 20 | 21 | $middleware->web(append: [ 22 | HandleAppearance::class, 23 | HandleInertiaRequests::class, 24 | AddLinkHeadersForPreloadedAssets::class, 25 | ]); 26 | }) 27 | ->withExceptions(function (Exceptions $exceptions): void { 28 | // 29 | })->create(); 30 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Filesystem Disks 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Below you may configure as many filesystem disks as necessary, and you 26 | | may even configure multiple disks for the same driver. Examples for 27 | | most supported storage drivers are configured here for reference. 28 | | 29 | | Supported drivers: "local", "ftp", "sftp", "s3" 30 | | 31 | */ 32 | 33 | 'disks' => [ 34 | 35 | 'local' => [ 36 | 'driver' => 'local', 37 | 'root' => storage_path('app/private'), 38 | 'serve' => true, 39 | 'throw' => false, 40 | 'report' => false, 41 | ], 42 | 43 | 'public' => [ 44 | 'driver' => 'local', 45 | 'root' => storage_path('app/public'), 46 | 'url' => env('APP_URL').'/storage', 47 | 'visibility' => 'public', 48 | 'throw' => false, 49 | 'report' => false, 50 | ], 51 | 52 | 's3' => [ 53 | 'driver' => 's3', 54 | 'key' => env('AWS_ACCESS_KEY_ID'), 55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 56 | 'region' => env('AWS_DEFAULT_REGION'), 57 | 'bucket' => env('AWS_BUCKET'), 58 | 'url' => env('AWS_URL'), 59 | 'endpoint' => env('AWS_ENDPOINT'), 60 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 61 | 'throw' => false, 62 | 'report' => false, 63 | ], 64 | 65 | ], 66 | 67 | /* 68 | |-------------------------------------------------------------------------- 69 | | Symbolic Links 70 | |-------------------------------------------------------------------------- 71 | | 72 | | Here you may configure the symbolic links that will be created when the 73 | | `storage:link` Artisan command is executed. The array keys should be 74 | | the locations of the links and the values should be their targets. 75 | | 76 | */ 77 | 78 | 'links' => [ 79 | public_path('storage') => storage_path('app/public'), 80 | ], 81 | 82 | ]; 83 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 20 | 'token' => env('POSTMARK_TOKEN'), 21 | ], 22 | 23 | 'ses' => [ 24 | 'key' => env('AWS_ACCESS_KEY_ID'), 25 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 26 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 27 | ], 28 | 29 | 'resend' => [ 30 | 'key' => env('RESEND_KEY'), 31 | ], 32 | 33 | 'slack' => [ 34 | 'notifications' => [ 35 | 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), 36 | 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), 37 | ], 38 | ], 39 | 40 | ]; 41 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | final class UserFactory extends Factory 16 | { 17 | /** 18 | * The current password being used by the factory. 19 | */ 20 | private static ?string $password = null; 21 | 22 | /** 23 | * Define the model's default state. 24 | * 25 | * @return array, mixed> 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' => self::$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): array => [ 44 | 'email_verified_at' => null, 45 | ]); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | 26 | Schema::create('password_reset_tokens', function (Blueprint $table): void { 27 | $table->string('email')->primary(); 28 | $table->string('token'); 29 | $table->timestamp('created_at')->nullable(); 30 | }); 31 | 32 | Schema::create('sessions', function (Blueprint $table): void { 33 | $table->string('id')->primary(); 34 | $table->foreignId('user_id')->nullable()->index(); 35 | $table->string('ip_address', 45)->nullable(); 36 | $table->text('user_agent')->nullable(); 37 | $table->longText('payload'); 38 | $table->integer('last_activity')->index(); 39 | }); 40 | } 41 | 42 | /** 43 | * Reverse the migrations. 44 | */ 45 | public function down(): void 46 | { 47 | Schema::dropIfExists('users'); 48 | Schema::dropIfExists('password_reset_tokens'); 49 | Schema::dropIfExists('sessions'); 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000001_create_cache_table.php: -------------------------------------------------------------------------------- 1 | string('key')->primary(); 18 | $table->mediumText('value'); 19 | $table->integer('expiration'); 20 | }); 21 | 22 | Schema::create('cache_locks', function (Blueprint $table): void { 23 | $table->string('key')->primary(); 24 | $table->string('owner'); 25 | $table->integer('expiration'); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | */ 32 | public function down(): void 33 | { 34 | Schema::dropIfExists('cache'); 35 | Schema::dropIfExists('cache_locks'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000002_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('queue')->index(); 19 | $table->longText('payload'); 20 | $table->unsignedTinyInteger('attempts'); 21 | $table->unsignedInteger('reserved_at')->nullable(); 22 | $table->unsignedInteger('available_at'); 23 | $table->unsignedInteger('created_at'); 24 | }); 25 | 26 | Schema::create('job_batches', function (Blueprint $table): void { 27 | $table->string('id')->primary(); 28 | $table->string('name'); 29 | $table->integer('total_jobs'); 30 | $table->integer('pending_jobs'); 31 | $table->integer('failed_jobs'); 32 | $table->longText('failed_job_ids'); 33 | $table->mediumText('options')->nullable(); 34 | $table->integer('cancelled_at')->nullable(); 35 | $table->integer('created_at'); 36 | $table->integer('finished_at')->nullable(); 37 | }); 38 | 39 | Schema::create('failed_jobs', function (Blueprint $table): void { 40 | $table->id(); 41 | $table->string('uuid')->unique(); 42 | $table->text('connection'); 43 | $table->text('queue'); 44 | $table->longText('payload'); 45 | $table->longText('exception'); 46 | $table->timestamp('failed_at')->useCurrent(); 47 | }); 48 | } 49 | 50 | /** 51 | * Reverse the migrations. 52 | */ 53 | public function down(): void 54 | { 55 | Schema::dropIfExists('jobs'); 56 | Schema::dropIfExists('job_batches'); 57 | Schema::dropIfExists('failed_jobs'); 58 | } 59 | }; 60 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 19 | 20 | User::factory()->create([ 21 | 'name' => 'Test User', 22 | 'email' => 'test@example.com', 23 | ]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | import prettier from 'eslint-config-prettier'; 2 | import vue from 'eslint-plugin-vue'; 3 | 4 | import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'; 5 | 6 | export default defineConfigWithVueTs( 7 | vue.configs['flat/essential'], 8 | vueTsConfigs.recommended, 9 | { 10 | ignores: ['vendor', 'node_modules', 'public', 'bootstrap/ssr', 'tailwind.config.js', 'resources/js/components/ui/*'], 11 | }, 12 | { 13 | rules: { 14 | 'vue/multi-word-component-names': 'off', 15 | '@typescript-eslint/no-explicit-any': 'off', 16 | }, 17 | }, 18 | prettier, 19 | ); 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build", 6 | "build:ssr": "vite build && vite build --ssr", 7 | "dev": "vite", 8 | "format": "prettier --write resources/", 9 | "format:check": "prettier --check resources/", 10 | "lint": "eslint . --fix" 11 | }, 12 | "devDependencies": { 13 | "@eslint/js": "^9.19.0", 14 | "@types/node": "^22.13.5", 15 | "@vue/eslint-config-typescript": "^14.3.0", 16 | "eslint": "^9.17.0", 17 | "eslint-config-prettier": "^10.0.1", 18 | "eslint-plugin-vue": "^9.32.0", 19 | "prettier": "^3.4.2", 20 | "prettier-plugin-organize-imports": "^4.1.0", 21 | "prettier-plugin-tailwindcss": "^0.6.9", 22 | "typescript-eslint": "^8.23.0", 23 | "vue-tsc": "^2.2.4" 24 | }, 25 | "dependencies": { 26 | "@inertiajs/vue3": "^2.0.0-beta.3", 27 | "@vitejs/plugin-vue": "^5.2.1", 28 | "@vueuse/core": "^12.0.0", 29 | "autoprefixer": "^10.4.20", 30 | "class-variance-authority": "^0.7.1", 31 | "clsx": "^2.1.1", 32 | "concurrently": "^9.0.1", 33 | "laravel-vite-plugin": "^1.0", 34 | "lucide": "^0.468.0", 35 | "lucide-vue-next": "^0.468.0", 36 | "radix-vue": "^1.9.11", 37 | "tailwind-merge": "^2.5.5", 38 | "tailwindcss": "^3.4.1", 39 | "tailwindcss-animate": "^1.0.7", 40 | "typescript": "^5.2.2", 41 | "vite": "^6.2.0", 42 | "vue": "^3.5.13", 43 | "ziggy-js": "^2.4.2" 44 | }, 45 | "optionalDependencies": { 46 | "@rollup/rollup-linux-x64-gnu": "4.9.5", 47 | "@tailwindcss/oxide-linux-x64-gnu": "^4.0.1", 48 | "lightningcss-linux-x64-gnu": "^1.29.1" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - vendor/larastan/larastan/extension.neon 3 | - vendor/nesbot/carbon/extension.neon 4 | 5 | parameters: 6 | paths: 7 | - app 8 | - bootstrap 9 | - database/factories 10 | - routes 11 | - config 12 | level: max 13 | checkOctaneCompatibility: true 14 | checkModelProperties: true 15 | treatPhpDocTypesAsCertain: false 16 | excludePaths: 17 | - '**/ide-helper.php' 18 | - '**/ide_helper_models.php' 19 | - '**/phpstorm.meta.php' 20 | -------------------------------------------------------------------------------- /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 | 34 | -------------------------------------------------------------------------------- /pint.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "laravel", 3 | "rules": { 4 | "array_push": true, 5 | "backtick_to_shell_exec": true, 6 | "date_time_immutable": true, 7 | "declare_strict_types": true, 8 | "lowercase_keywords": true, 9 | "lowercase_static_reference": true, 10 | "final_class": true, 11 | "final_internal_class": true, 12 | "final_public_method_for_abstract_class": true, 13 | "fully_qualified_strict_types": true, 14 | "global_namespace_import": { 15 | "import_classes": true, 16 | "import_constants": true, 17 | "import_functions": true 18 | }, 19 | "mb_str_functions": true, 20 | "modernize_types_casting": true, 21 | "new_with_parentheses": false, 22 | "no_superfluous_elseif": true, 23 | "no_useless_else": true, 24 | "no_multiple_statements_per_line": true, 25 | "ordered_class_elements": { 26 | "order": [ 27 | "use_trait", 28 | "case", 29 | "constant", 30 | "constant_public", 31 | "constant_protected", 32 | "constant_private", 33 | "property_public", 34 | "property_protected", 35 | "property_private", 36 | "construct", 37 | "destruct", 38 | "magic", 39 | "phpunit", 40 | "method_abstract", 41 | "method_public_static", 42 | "method_public", 43 | "method_protected_static", 44 | "method_protected", 45 | "method_private_static", 46 | "method_private" 47 | ], 48 | "sort_algorithm": "none" 49 | }, 50 | "ordered_interfaces": true, 51 | "ordered_traits": true, 52 | "protected_to_private": true, 53 | "self_accessor": true, 54 | "self_static_accessor": true, 55 | "strict_comparison": true, 56 | "visibility_required": true 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /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 | # Handle X-XSRF-Token Header 13 | RewriteCond %{HTTP:x-xsrf-token} . 14 | RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}] 15 | 16 | # Redirect Trailing Slashes If Not A Folder... 17 | RewriteCond %{REQUEST_FILENAME} !-d 18 | RewriteCond %{REQUEST_URI} (.+)/$ 19 | RewriteRule ^ %1 [L,R=301] 20 | 21 | # Send Requests To Front Controller... 22 | RewriteCond %{REQUEST_FILENAME} !-d 23 | RewriteCond %{REQUEST_FILENAME} !-f 24 | RewriteRule ^ index.php [L] 25 | 26 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shipfastlabs/modern-vue-starter-kit/18ac01666681c38c232d091a619efad79a63631d/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 23 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /rector.php: -------------------------------------------------------------------------------- 1 | withPaths([ 12 | __DIR__.'/app', 13 | __DIR__.'/bootstrap/app.php', 14 | __DIR__.'/config', 15 | __DIR__.'/database', 16 | __DIR__.'/public', 17 | __DIR__.'/tests', 18 | ]) 19 | ->withSkip([ 20 | AddOverrideAttributeToOverriddenMethodsRector::class, 21 | EncapsedStringsToSprintfRector::class, 22 | ]) 23 | ->withPreparedSets( 24 | deadCode: true, 25 | codeQuality: true, 26 | typeDeclarations: true, 27 | privatization: true, 28 | earlyReturn: true, 29 | strictBooleans: true, 30 | codingStyle: true, 31 | ) 32 | ->withPhpSets(php83: true) 33 | ->withSets([ 34 | LaravelSetList::LARAVEL_CODE_QUALITY, 35 | LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER, 36 | LaravelSetList::LARAVEL_IF_HELPERS, 37 | LaravelSetList::LARAVEL_CONTAINER_STRING_TO_FULLY_QUALIFIED_NAME, 38 | LaravelSetList::LARAVEL_COLLECTION, 39 | ]); 40 | -------------------------------------------------------------------------------- /resources/js/app.ts: -------------------------------------------------------------------------------- 1 | import '../css/app.css'; 2 | 3 | import { createInertiaApp } from '@inertiajs/vue3'; 4 | import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; 5 | import type { DefineComponent } from 'vue'; 6 | import { createApp, h } from 'vue'; 7 | import { ZiggyVue } from 'ziggy-js'; 8 | import { initializeTheme } from './composables/useAppearance'; 9 | 10 | // Extend ImportMeta interface for Vite... 11 | declare module 'vite/client' { 12 | interface ImportMetaEnv { 13 | readonly VITE_APP_NAME: string; 14 | [key: string]: string | boolean | undefined; 15 | } 16 | 17 | interface ImportMeta { 18 | readonly env: ImportMetaEnv; 19 | readonly glob: (pattern: string) => Record Promise>; 20 | } 21 | } 22 | 23 | const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; 24 | 25 | createInertiaApp({ 26 | title: (title) => `${title} - ${appName}`, 27 | resolve: (name) => resolvePageComponent(`./pages/${name}.vue`, import.meta.glob('./pages/**/*.vue')), 28 | setup({ el, App, props, plugin }) { 29 | createApp({ render: () => h(App, props) }) 30 | .use(plugin) 31 | .use(ZiggyVue) 32 | .mount(el); 33 | }, 34 | progress: { 35 | color: '#4B5563', 36 | }, 37 | }); 38 | 39 | // This will set light / dark mode on page load... 40 | initializeTheme(); 41 | -------------------------------------------------------------------------------- /resources/js/components/AppContent.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 22 | -------------------------------------------------------------------------------- /resources/js/components/AppLogo.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /resources/js/components/AppLogoIcon.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 25 | -------------------------------------------------------------------------------- /resources/js/components/AppShell.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 31 | -------------------------------------------------------------------------------- /resources/js/components/AppSidebar.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 58 | -------------------------------------------------------------------------------- /resources/js/components/AppSidebarHeader.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 23 | -------------------------------------------------------------------------------- /resources/js/components/AppearanceTabs.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 38 | -------------------------------------------------------------------------------- /resources/js/components/Breadcrumbs.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 34 | -------------------------------------------------------------------------------- /resources/js/components/Heading.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /resources/js/components/HeadingSmall.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /resources/js/components/Icon.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 31 | -------------------------------------------------------------------------------- /resources/js/components/InputError.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /resources/js/components/NavFooter.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 29 | -------------------------------------------------------------------------------- /resources/js/components/NavMain.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 31 | -------------------------------------------------------------------------------- /resources/js/components/NavUser.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 37 | -------------------------------------------------------------------------------- /resources/js/components/PlaceholderPattern.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | -------------------------------------------------------------------------------- /resources/js/components/TextLink.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 25 | -------------------------------------------------------------------------------- /resources/js/components/UserInfo.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 35 | -------------------------------------------------------------------------------- /resources/js/components/UserMenuContent.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 38 | -------------------------------------------------------------------------------- /resources/js/components/ui/avatar/Avatar.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 25 | -------------------------------------------------------------------------------- /resources/js/components/ui/avatar/AvatarFallback.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/avatar/AvatarImage.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /resources/js/components/ui/avatar/index.ts: -------------------------------------------------------------------------------- 1 | import { cva, type VariantProps } from 'class-variance-authority'; 2 | 3 | export { default as Avatar } from './Avatar.vue'; 4 | export { default as AvatarFallback } from './AvatarFallback.vue'; 5 | export { default as AvatarImage } from './AvatarImage.vue'; 6 | 7 | export const avatarVariant = cva( 8 | 'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden', 9 | { 10 | variants: { 11 | size: { 12 | sm: 'h-10 w-10 text-xs', 13 | base: 'h-16 w-16 text-2xl', 14 | lg: 'h-32 w-32 text-5xl', 15 | }, 16 | shape: { 17 | circle: 'rounded-full', 18 | square: 'rounded-md', 19 | }, 20 | }, 21 | }, 22 | ); 23 | 24 | export type AvatarVariants = VariantProps; 25 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/Breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/BreadcrumbEllipsis.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 19 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/BreadcrumbItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/BreadcrumbLink.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/BreadcrumbList.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/BreadcrumbPage.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/BreadcrumbSeparator.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | -------------------------------------------------------------------------------- /resources/js/components/ui/breadcrumb/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Breadcrumb } from './Breadcrumb.vue'; 2 | export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue'; 3 | export { default as BreadcrumbItem } from './BreadcrumbItem.vue'; 4 | export { default as BreadcrumbLink } from './BreadcrumbLink.vue'; 5 | export { default as BreadcrumbList } from './BreadcrumbList.vue'; 6 | export { default as BreadcrumbPage } from './BreadcrumbPage.vue'; 7 | export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue'; 8 | -------------------------------------------------------------------------------- /resources/js/components/ui/button/Button.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /resources/js/components/ui/button/index.ts: -------------------------------------------------------------------------------- 1 | import { cva, type VariantProps } from 'class-variance-authority'; 2 | 3 | export { default as Button } from './Button.vue'; 4 | 5 | export const buttonVariants = cva( 6 | 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', 7 | { 8 | variants: { 9 | variant: { 10 | default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90', 11 | destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90', 12 | outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground', 13 | secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80', 14 | ghost: 'hover:bg-accent hover:text-accent-foreground', 15 | link: 'text-primary underline-offset-4 hover:underline', 16 | }, 17 | size: { 18 | default: 'h-9 px-4 py-2', 19 | sm: 'h-8 rounded-md px-3 text-xs', 20 | lg: 'h-10 rounded-md px-8', 21 | icon: 'h-9 w-9', 22 | }, 23 | }, 24 | defaultVariants: { 25 | variant: 'default', 26 | size: 'default', 27 | }, 28 | }, 29 | ); 30 | 31 | export type ButtonVariants = VariantProps; 32 | -------------------------------------------------------------------------------- /resources/js/components/ui/card/Card.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/card/CardContent.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/card/CardDescription.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/card/CardFooter.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/card/CardHeader.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/card/CardTitle.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/card/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Card } from './Card.vue'; 2 | export { default as CardContent } from './CardContent.vue'; 3 | export { default as CardDescription } from './CardDescription.vue'; 4 | export { default as CardFooter } from './CardFooter.vue'; 5 | export { default as CardHeader } from './CardHeader.vue'; 6 | export { default as CardTitle } from './CardTitle.vue'; 7 | -------------------------------------------------------------------------------- /resources/js/components/ui/checkbox/Checkbox.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 34 | -------------------------------------------------------------------------------- /resources/js/components/ui/checkbox/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Checkbox } from './Checkbox.vue' 2 | -------------------------------------------------------------------------------- /resources/js/components/ui/collapsible/Collapsible.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /resources/js/components/ui/collapsible/CollapsibleContent.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/collapsible/CollapsibleTrigger.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/collapsible/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Collapsible } from './Collapsible.vue'; 2 | export { default as CollapsibleContent } from './CollapsibleContent.vue'; 3 | export { default as CollapsibleTrigger } from './CollapsibleTrigger.vue'; 4 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/Dialog.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogClose.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogContent.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 52 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogDescription.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogFooter.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogHeader.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogScrollContent.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 60 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogTitle.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/DialogTrigger.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/dialog/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Dialog } from './Dialog.vue'; 2 | export { default as DialogClose } from './DialogClose.vue'; 3 | export { default as DialogContent } from './DialogContent.vue'; 4 | export { default as DialogDescription } from './DialogDescription.vue'; 5 | export { default as DialogFooter } from './DialogFooter.vue'; 6 | export { default as DialogHeader } from './DialogHeader.vue'; 7 | export { default as DialogScrollContent } from './DialogScrollContent.vue'; 8 | export { default as DialogTitle } from './DialogTitle.vue'; 9 | export { default as DialogTrigger } from './DialogTrigger.vue'; 10 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenu.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 43 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuContent.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 41 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuGroup.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuItem.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 31 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuLabel.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuRadioItem.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 44 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuSeparator.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuShortcut.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuSub.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuSubContent.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 31 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 32 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/DropdownMenuTrigger.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /resources/js/components/ui/dropdown-menu/index.ts: -------------------------------------------------------------------------------- 1 | export { default as DropdownMenu } from './DropdownMenu.vue'; 2 | 3 | export { DropdownMenuPortal } from 'radix-vue'; 4 | export { default as DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem.vue'; 5 | export { default as DropdownMenuContent } from './DropdownMenuContent.vue'; 6 | export { default as DropdownMenuGroup } from './DropdownMenuGroup.vue'; 7 | export { default as DropdownMenuItem } from './DropdownMenuItem.vue'; 8 | export { default as DropdownMenuLabel } from './DropdownMenuLabel.vue'; 9 | export { default as DropdownMenuRadioGroup } from './DropdownMenuRadioGroup.vue'; 10 | export { default as DropdownMenuRadioItem } from './DropdownMenuRadioItem.vue'; 11 | export { default as DropdownMenuSeparator } from './DropdownMenuSeparator.vue'; 12 | export { default as DropdownMenuShortcut } from './DropdownMenuShortcut.vue'; 13 | export { default as DropdownMenuSub } from './DropdownMenuSub.vue'; 14 | export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue'; 15 | export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue'; 16 | export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue'; 17 | -------------------------------------------------------------------------------- /resources/js/components/ui/input/Input.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 33 | -------------------------------------------------------------------------------- /resources/js/components/ui/input/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Input } from './Input.vue'; 2 | -------------------------------------------------------------------------------- /resources/js/components/ui/label/Label.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 23 | -------------------------------------------------------------------------------- /resources/js/components/ui/label/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Label } from './Label.vue'; 2 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenu.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 34 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenuContent.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 35 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenuIndicator.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 25 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenuItem.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenuLink.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenuList.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 30 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenuTrigger.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 35 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/NavigationMenuViewport.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 34 | -------------------------------------------------------------------------------- /resources/js/components/ui/navigation-menu/index.ts: -------------------------------------------------------------------------------- 1 | import { cva } from 'class-variance-authority' 2 | 3 | export { default as NavigationMenu } from './NavigationMenu.vue' 4 | export { default as NavigationMenuContent } from './NavigationMenuContent.vue' 5 | export { default as NavigationMenuIndicator } from './NavigationMenuIndicator.vue' 6 | export { default as NavigationMenuItem } from './NavigationMenuItem.vue' 7 | export { default as NavigationMenuLink } from './NavigationMenuLink.vue' 8 | export { default as NavigationMenuList } from './NavigationMenuList.vue' 9 | export { default as NavigationMenuTrigger } from './NavigationMenuTrigger.vue' 10 | export { default as NavigationMenuViewport } from './NavigationMenuViewport.vue' 11 | 12 | export const navigationMenuTriggerStyle = cva( 13 | 'group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50', 14 | ) 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/separator/Separator.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 32 | -------------------------------------------------------------------------------- /resources/js/components/ui/separator/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Separator } from './Separator.vue'; 2 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/Sheet.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/SheetClose.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/SheetContent.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 54 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/SheetDescription.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/SheetFooter.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/SheetHeader.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/SheetTitle.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/SheetTrigger.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/sheet/index.ts: -------------------------------------------------------------------------------- 1 | import { cva, type VariantProps } from 'class-variance-authority'; 2 | 3 | export { default as Sheet } from './Sheet.vue'; 4 | export { default as SheetClose } from './SheetClose.vue'; 5 | export { default as SheetContent } from './SheetContent.vue'; 6 | export { default as SheetDescription } from './SheetDescription.vue'; 7 | export { default as SheetFooter } from './SheetFooter.vue'; 8 | export { default as SheetHeader } from './SheetHeader.vue'; 9 | export { default as SheetTitle } from './SheetTitle.vue'; 10 | export { default as SheetTrigger } from './SheetTrigger.vue'; 11 | 12 | export const sheetVariants = cva( 13 | 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', 14 | { 15 | variants: { 16 | side: { 17 | top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top', 18 | bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom', 19 | left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm', 20 | right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm', 21 | }, 22 | }, 23 | defaultVariants: { 24 | side: 'right', 25 | }, 26 | }, 27 | ); 28 | 29 | export type SheetVariants = VariantProps; 30 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarContent.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarFooter.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarGroup.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarGroupAction.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 32 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarGroupContent.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarGroupLabel.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 30 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarHeader.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarInput.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarInset.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 23 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenu.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuAction.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 42 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuBadge.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 28 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuButton.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 53 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuButtonChild.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 34 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuSkeleton.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 23 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuSub.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 24 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuSubButton.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 43 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarMenuSubItem.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarProvider.vue: -------------------------------------------------------------------------------- 1 | 76 | 77 | 90 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarRail.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 35 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarSeparator.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/SidebarTrigger.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 21 | -------------------------------------------------------------------------------- /resources/js/components/ui/sidebar/utils.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from 'radix-vue'; 2 | import type { ComputedRef, Ref } from 'vue'; 3 | 4 | export const SIDEBAR_COOKIE_NAME = 'sidebar:state'; 5 | export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7; 6 | export const SIDEBAR_WIDTH = '16rem'; 7 | export const SIDEBAR_WIDTH_MOBILE = '18rem'; 8 | export const SIDEBAR_WIDTH_ICON = '3rem'; 9 | export const SIDEBAR_KEYBOARD_SHORTCUT = 'b'; 10 | 11 | export const [useSidebar, provideSidebarContext] = createContext<{ 12 | state: ComputedRef<'expanded' | 'collapsed'>; 13 | open: Ref; 14 | setOpen: (value: boolean) => void; 15 | isMobile: Ref; 16 | openMobile: Ref; 17 | setOpenMobile: (value: boolean) => void; 18 | toggleSidebar: () => void; 19 | }>('Sidebar'); 20 | -------------------------------------------------------------------------------- /resources/js/components/ui/skeleton/Skeleton.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/skeleton/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Skeleton } from './Skeleton.vue'; 2 | -------------------------------------------------------------------------------- /resources/js/components/ui/tooltip/Tooltip.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/components/ui/tooltip/TooltipContent.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 40 | -------------------------------------------------------------------------------- /resources/js/components/ui/tooltip/TooltipProvider.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/tooltip/TooltipTrigger.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/ui/tooltip/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Tooltip } from './Tooltip.vue'; 2 | export { default as TooltipContent } from './TooltipContent.vue'; 3 | export { default as TooltipProvider } from './TooltipProvider.vue'; 4 | export { default as TooltipTrigger } from './TooltipTrigger.vue'; 5 | -------------------------------------------------------------------------------- /resources/js/composables/useAppearance.ts: -------------------------------------------------------------------------------- 1 | import { onMounted, ref } from 'vue'; 2 | 3 | type Appearance = 'light' | 'dark' | 'system'; 4 | 5 | export function updateTheme(value: Appearance) { 6 | if (typeof window === 'undefined') { 7 | return; 8 | } 9 | 10 | if (value === 'system') { 11 | const mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)'); 12 | const systemTheme = mediaQueryList.matches ? 'dark' : 'light'; 13 | 14 | document.documentElement.classList.toggle('dark', systemTheme === 'dark'); 15 | } else { 16 | document.documentElement.classList.toggle('dark', value === 'dark'); 17 | } 18 | } 19 | 20 | const setCookie = (name: string, value: string, days = 365) => { 21 | if (typeof document === 'undefined') { 22 | return; 23 | } 24 | 25 | const maxAge = days * 24 * 60 * 60; 26 | 27 | document.cookie = `${name}=${value};path=/;max-age=${maxAge};SameSite=Lax`; 28 | }; 29 | 30 | const mediaQuery = () => { 31 | if (typeof window === 'undefined') { 32 | return null; 33 | } 34 | 35 | return window.matchMedia('(prefers-color-scheme: dark)'); 36 | }; 37 | 38 | const getStoredAppearance = () => { 39 | if (typeof window === 'undefined') { 40 | return null; 41 | } 42 | 43 | return localStorage.getItem('appearance') as Appearance | null; 44 | }; 45 | 46 | const handleSystemThemeChange = () => { 47 | const currentAppearance = getStoredAppearance(); 48 | 49 | updateTheme(currentAppearance || 'system'); 50 | }; 51 | 52 | export function initializeTheme() { 53 | if (typeof window === 'undefined') { 54 | return; 55 | } 56 | 57 | // Initialize theme from saved preference or default to system... 58 | const savedAppearance = getStoredAppearance(); 59 | updateTheme(savedAppearance || 'system'); 60 | 61 | // Set up system theme change listener... 62 | mediaQuery()?.addEventListener('change', handleSystemThemeChange); 63 | } 64 | 65 | export function useAppearance() { 66 | const appearance = ref('system'); 67 | 68 | onMounted(() => { 69 | initializeTheme(); 70 | 71 | const savedAppearance = localStorage.getItem('appearance') as Appearance | null; 72 | 73 | if (savedAppearance) { 74 | appearance.value = savedAppearance; 75 | } 76 | }); 77 | 78 | function updateAppearance(value: Appearance) { 79 | appearance.value = value; 80 | 81 | // Store in localStorage for client-side persistence... 82 | localStorage.setItem('appearance', value); 83 | 84 | // Store in cookie for SSR... 85 | setCookie('appearance', value); 86 | 87 | updateTheme(value); 88 | } 89 | 90 | return { 91 | appearance, 92 | updateAppearance, 93 | }; 94 | } 95 | -------------------------------------------------------------------------------- /resources/js/composables/useInitials.ts: -------------------------------------------------------------------------------- 1 | export function getInitials(fullName?: string): string { 2 | if (!fullName) return ''; 3 | 4 | const names = fullName.trim().split(' '); 5 | 6 | if (names.length === 0) return ''; 7 | if (names.length === 1) return names[0].charAt(0).toUpperCase(); 8 | 9 | return `${names[0].charAt(0)}${names[names.length - 1].charAt(0)}`.toUpperCase(); 10 | } 11 | 12 | export function useInitials() { 13 | return { getInitials }; 14 | } 15 | -------------------------------------------------------------------------------- /resources/js/layouts/AppLayout.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | -------------------------------------------------------------------------------- /resources/js/layouts/AuthLayout.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/layouts/app/AppHeaderLayout.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 24 | -------------------------------------------------------------------------------- /resources/js/layouts/app/AppSidebarLayout.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | -------------------------------------------------------------------------------- /resources/js/layouts/auth/AuthCardLayout.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 37 | -------------------------------------------------------------------------------- /resources/js/layouts/auth/AuthSimpleLayout.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 32 | -------------------------------------------------------------------------------- /resources/js/layouts/auth/AuthSplitLayout.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 41 | -------------------------------------------------------------------------------- /resources/js/layouts/settings/Layout.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 59 | -------------------------------------------------------------------------------- /resources/js/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx, type ClassValue } from 'clsx'; 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /resources/js/pages/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 37 | -------------------------------------------------------------------------------- /resources/js/pages/auth/ConfirmPassword.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 54 | -------------------------------------------------------------------------------- /resources/js/pages/auth/ForgotPassword.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 55 | -------------------------------------------------------------------------------- /resources/js/pages/auth/VerifyEmail.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 37 | -------------------------------------------------------------------------------- /resources/js/pages/settings/Appearance.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 31 | -------------------------------------------------------------------------------- /resources/js/ssr.ts: -------------------------------------------------------------------------------- 1 | import { createInertiaApp } from '@inertiajs/vue3'; 2 | import createServer from '@inertiajs/vue3/server'; 3 | import { renderToString } from '@vue/server-renderer'; 4 | import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; 5 | import { createSSRApp, h } from 'vue'; 6 | import { route as ziggyRoute } from 'ziggy-js'; 7 | 8 | const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; 9 | 10 | createServer((page) => 11 | createInertiaApp({ 12 | page, 13 | render: renderToString, 14 | title: (title) => `${title} - ${appName}`, 15 | resolve: (name) => resolvePageComponent(`./pages/${name}.vue`, import.meta.glob('./pages/**/*.vue')), 16 | setup({ App, props, plugin }) { 17 | const app = createSSRApp({ render: () => h(App, props) }); 18 | 19 | // Configure Ziggy for SSR... 20 | const ziggyConfig = { 21 | ...page.props.ziggy, 22 | location: new URL(page.props.ziggy.location), 23 | }; 24 | 25 | // Create route function... 26 | const route = (name: string, params?: any, absolute?: boolean) => ziggyRoute(name, params, absolute, ziggyConfig); 27 | 28 | // Make route function available globally... 29 | app.config.globalProperties.route = route; 30 | 31 | // Make route function available globally for SSR... 32 | if (typeof window === 'undefined') { 33 | global.route = route; 34 | } 35 | 36 | app.use(plugin); 37 | 38 | return app; 39 | }, 40 | }), 41 | ); 42 | -------------------------------------------------------------------------------- /resources/js/types/globals.d.ts: -------------------------------------------------------------------------------- 1 | import type { route as routeFn } from 'ziggy-js'; 2 | 3 | declare global { 4 | const route: typeof routeFn; 5 | } 6 | -------------------------------------------------------------------------------- /resources/js/types/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { PageProps } from '@inertiajs/core'; 2 | import type { LucideIcon } from 'lucide-vue-next'; 3 | import type { Config } from 'ziggy-js'; 4 | 5 | export interface Auth { 6 | user: User; 7 | } 8 | 9 | export interface BreadcrumbItem { 10 | title: string; 11 | href: string; 12 | } 13 | 14 | export interface NavItem { 15 | title: string; 16 | href: string; 17 | icon?: LucideIcon; 18 | isActive?: boolean; 19 | } 20 | 21 | export interface SharedData extends PageProps { 22 | name: string; 23 | quote: { message: string; author: string }; 24 | auth: Auth; 25 | ziggy: Config & { location: string }; 26 | } 27 | 28 | export interface User { 29 | id: number; 30 | name: string; 31 | email: string; 32 | avatar?: string; 33 | email_verified_at: string | null; 34 | created_at: string; 35 | updated_at: string; 36 | } 37 | 38 | export type BreadcrumbItemType = BreadcrumbItem; 39 | -------------------------------------------------------------------------------- /resources/js/types/ziggy.d.ts: -------------------------------------------------------------------------------- 1 | import { RouteParams, Router } from 'ziggy-js'; 2 | 3 | declare global { 4 | function route(): Router; 5 | function route(name: string, params?: RouteParams | undefined, absolute?: boolean): string; 6 | } 7 | 8 | declare module '@vue/runtime-core' { 9 | interface ComponentCustomProperties { 10 | route: typeof route; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /resources/views/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | ($appearance ?? 'system') == 'dark'])> 3 | 4 | 5 | 6 | 7 | {{-- Inline script to detect system dark mode preference and apply it immediately --}} 8 | 21 | 22 | {{-- Inline style to set the HTML background color based on our theme in app.css --}} 23 | 32 | 33 | {{ config('app.name', 'Laravel') }} 34 | 35 | 36 | 37 | 38 | @routes 39 | @vite(['resources/js/app.ts']) 40 | @inertiaHead 41 | 42 | 43 | @inertia 44 | 45 | 46 | -------------------------------------------------------------------------------- /routes/auth.php: -------------------------------------------------------------------------------- 1 | group(function () { 16 | Route::get('register', [RegisteredUserController::class, 'create']) 17 | ->name('register'); 18 | 19 | Route::post('register', [RegisteredUserController::class, 'store']); 20 | 21 | Route::get('login', [AuthenticatedSessionController::class, 'create']) 22 | ->name('login'); 23 | 24 | Route::post('login', [AuthenticatedSessionController::class, 'store']); 25 | 26 | Route::get('forgot-password', [PasswordResetLinkController::class, 'create']) 27 | ->name('password.request'); 28 | 29 | Route::post('forgot-password', [PasswordResetLinkController::class, 'store']) 30 | ->name('password.email'); 31 | 32 | Route::get('reset-password/{token}', [NewPasswordController::class, 'create']) 33 | ->name('password.reset'); 34 | 35 | Route::post('reset-password', [NewPasswordController::class, 'store']) 36 | ->name('password.store'); 37 | }); 38 | 39 | Route::middleware('auth')->group(function () { 40 | Route::get('verify-email', EmailVerificationPromptController::class) 41 | ->name('verification.notice'); 42 | 43 | Route::get('verify-email/{id}/{hash}', VerifyEmailController::class) 44 | ->middleware(['signed', 'throttle:6,1']) 45 | ->name('verification.verify'); 46 | 47 | Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store']) 48 | ->middleware('throttle:6,1') 49 | ->name('verification.send'); 50 | 51 | Route::get('confirm-password', [ConfirmablePasswordController::class, 'show']) 52 | ->name('password.confirm'); 53 | 54 | Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']); 55 | 56 | Route::post('logout', [AuthenticatedSessionController::class, 'destroy']) 57 | ->name('logout'); 58 | }); 59 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 10 | })->purpose('Display an inspiring quote'); 11 | -------------------------------------------------------------------------------- /routes/settings.php: -------------------------------------------------------------------------------- 1 | group(function () { 11 | Route::redirect('settings', '/settings/profile'); 12 | 13 | Route::get('settings/profile', [ProfileController::class, 'edit'])->name('profile.edit'); 14 | Route::patch('settings/profile', [ProfileController::class, 'update'])->name('profile.update'); 15 | Route::delete('settings/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); 16 | 17 | Route::get('settings/password', [PasswordController::class, 'edit'])->name('password.edit'); 18 | Route::put('settings/password', [PasswordController::class, 'update'])->name('password.update'); 19 | 20 | Route::get('settings/appearance', function () { 21 | return Inertia::render('settings/Appearance'); 22 | })->name('appearance'); 23 | }); 24 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('home'); 11 | 12 | Route::get('dashboard', function () { 13 | return Inertia::render('Dashboard'); 14 | })->middleware(['auth', 'verified'])->name('dashboard'); 15 | 16 | require __DIR__.'/settings.php'; 17 | require __DIR__.'/auth.php'; 18 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !private/ 3 | !public/ 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /storage/app/private/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/Feature/Auth/AuthenticationTest.php: -------------------------------------------------------------------------------- 1 | get('/login'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | 22 | public function test_users_can_authenticate_using_the_login_screen(): void 23 | { 24 | $user = User::factory()->create(); 25 | 26 | $response = $this->post('/login', [ 27 | 'email' => $user->email, 28 | 'password' => 'password', 29 | ]); 30 | 31 | $this->assertAuthenticated(); 32 | $response->assertRedirect(route('dashboard', absolute: false)); 33 | } 34 | 35 | public function test_users_can_not_authenticate_with_invalid_password(): void 36 | { 37 | $user = User::factory()->create(); 38 | 39 | $this->post('/login', [ 40 | 'email' => $user->email, 41 | 'password' => 'wrong-password', 42 | ]); 43 | 44 | $this->assertGuest(); 45 | } 46 | 47 | public function test_users_can_logout(): void 48 | { 49 | $user = User::factory()->create(); 50 | 51 | $response = $this->actingAs($user)->post('/logout'); 52 | 53 | $this->assertGuest(); 54 | $response->assertRedirect('/'); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /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 | 31 | Event::fake(); 32 | 33 | $verificationUrl = URL::temporarySignedRoute( 34 | 'verification.verify', 35 | now()->addMinutes(60), 36 | ['id' => $user->id, 'hash' => sha1((string) $user->email)] 37 | ); 38 | 39 | $response = $this->actingAs($user)->get($verificationUrl); 40 | 41 | Event::assertDispatched(Verified::class); 42 | $this->assertTrue($user->fresh()->hasVerifiedEmail()); 43 | $response->assertRedirect(route('dashboard', absolute: false).'?verified=1'); 44 | } 45 | 46 | public function test_email_is_not_verified_with_invalid_hash(): void 47 | { 48 | $user = User::factory()->unverified()->create(); 49 | 50 | $verificationUrl = URL::temporarySignedRoute( 51 | 'verification.verify', 52 | now()->addMinutes(60), 53 | ['id' => $user->id, 'hash' => sha1('wrong-email')] 54 | ); 55 | 56 | $this->actingAs($user)->get($verificationUrl); 57 | 58 | $this->assertFalse($user->fresh()->hasVerifiedEmail()); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /tests/Feature/Auth/PasswordConfirmationTest.php: -------------------------------------------------------------------------------- 1 | create(); 18 | 19 | $response = $this->actingAs($user)->get('/confirm-password'); 20 | 21 | $response->assertStatus(200); 22 | } 23 | 24 | public function test_password_can_be_confirmed(): void 25 | { 26 | $user = User::factory()->create(); 27 | 28 | $response = $this->actingAs($user)->post('/confirm-password', [ 29 | 'password' => 'password', 30 | ]); 31 | 32 | $response->assertRedirect(); 33 | $response->assertSessionHasNoErrors(); 34 | } 35 | 36 | public function test_password_is_not_confirmed_with_invalid_password(): void 37 | { 38 | $user = User::factory()->create(); 39 | 40 | $response = $this->actingAs($user)->post('/confirm-password', [ 41 | 'password' => 'wrong-password', 42 | ]); 43 | 44 | $response->assertSessionHasErrors(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/Feature/Auth/PasswordResetTest.php: -------------------------------------------------------------------------------- 1 | get('/forgot-password'); 20 | 21 | $response->assertStatus(200); 22 | } 23 | 24 | public function test_reset_password_link_can_be_requested(): void 25 | { 26 | Notification::fake(); 27 | 28 | $user = User::factory()->create(); 29 | 30 | $this->post('/forgot-password', ['email' => $user->email]); 31 | 32 | Notification::assertSentTo($user, ResetPassword::class); 33 | } 34 | 35 | public function test_reset_password_screen_can_be_rendered(): void 36 | { 37 | Notification::fake(); 38 | 39 | $user = User::factory()->create(); 40 | 41 | $this->post('/forgot-password', ['email' => $user->email]); 42 | 43 | Notification::assertSentTo($user, ResetPassword::class, function ($notification): true { 44 | $response = $this->get('/reset-password/'.$notification->token); 45 | 46 | $response->assertStatus(200); 47 | 48 | return true; 49 | }); 50 | } 51 | 52 | public function test_password_can_be_reset_with_valid_token(): void 53 | { 54 | Notification::fake(); 55 | 56 | $user = User::factory()->create(); 57 | 58 | $this->post('/forgot-password', ['email' => $user->email]); 59 | 60 | Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user): true { 61 | $response = $this->post('/reset-password', [ 62 | 'token' => $notification->token, 63 | 'email' => $user->email, 64 | 'password' => 'password', 65 | 'password_confirmation' => 'password', 66 | ]); 67 | 68 | $response 69 | ->assertSessionHasNoErrors() 70 | ->assertRedirect(route('login')); 71 | 72 | return true; 73 | }); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /tests/Feature/Auth/RegistrationTest.php: -------------------------------------------------------------------------------- 1 | get('/register'); 17 | 18 | $response->assertStatus(200); 19 | } 20 | 21 | public function test_new_users_can_register(): void 22 | { 23 | $response = $this->post('/register', [ 24 | 'name' => 'Test User', 25 | 'email' => 'test@example.com', 26 | 'password' => 'password', 27 | 'password_confirmation' => 'password', 28 | ]); 29 | 30 | $this->assertAuthenticated(); 31 | $response->assertRedirect(route('dashboard', absolute: false)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/Feature/DashboardTest.php: -------------------------------------------------------------------------------- 1 | get('/dashboard'); 18 | $response->assertRedirect('/login'); 19 | } 20 | 21 | public function test_authenticated_users_can_visit_the_dashboard(): void 22 | { 23 | $user = User::factory()->create(); 24 | $this->actingAs($user); 25 | 26 | $response = $this->get('/dashboard'); 27 | $response->assertStatus(200); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 17 | 18 | $response->assertStatus(200); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Feature/Settings/PasswordUpdateTest.php: -------------------------------------------------------------------------------- 1 | create(); 19 | 20 | $response = $this 21 | ->actingAs($user) 22 | ->from('/settings/password') 23 | ->put('/settings/password', [ 24 | 'current_password' => 'password', 25 | 'password' => 'new-password', 26 | 'password_confirmation' => 'new-password', 27 | ]); 28 | 29 | $response 30 | ->assertSessionHasNoErrors() 31 | ->assertRedirect('/settings/password'); 32 | 33 | $this->assertTrue(Hash::check('new-password', $user->refresh()->password)); 34 | } 35 | 36 | public function test_correct_password_must_be_provided_to_update_password(): void 37 | { 38 | $user = User::factory()->create(); 39 | 40 | $response = $this 41 | ->actingAs($user) 42 | ->from('/settings/password') 43 | ->put('/settings/password', [ 44 | 'current_password' => 'wrong-password', 45 | 'password' => 'new-password', 46 | 'password_confirmation' => 'new-password', 47 | ]); 48 | 49 | $response 50 | ->assertSessionHasErrors('current_password') 51 | ->assertRedirect('/settings/password'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /tests/Pest.php: -------------------------------------------------------------------------------- 1 | extend(Tests\TestCase::class) 17 | ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) 18 | ->in('Feature'); 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Expectations 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When you're writing tests, you often need to check that values meet certain conditions. The 26 | | "expect()" function gives you access to a set of "expectations" methods that you can use 27 | | to assert different things. Of course, you may extend the Expectation API at any time. 28 | | 29 | */ 30 | 31 | expect()->extend('toBeOne', fn () => $this->toBe(1)); 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Functions 36 | |-------------------------------------------------------------------------- 37 | | 38 | | While Pest is very powerful out-of-the-box, you may have some testing code specific to your 39 | | project that you don't want to repeat in every file. Here you can also expose helpers as 40 | | global functions to help you to reduce the number of lines of code in your test files. 41 | | 42 | */ 43 | 44 | function something(): void 45 | { 46 | // .. 47 | } 48 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | preset()->php(); 6 | arch()->preset()->security(); 7 | arch()->preset()->laravel(); 8 | -------------------------------------------------------------------------------- /tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import vue from '@vitejs/plugin-vue'; 2 | import autoprefixer from 'autoprefixer'; 3 | import laravel from 'laravel-vite-plugin'; 4 | import path from 'path'; 5 | import tailwindcss from 'tailwindcss'; 6 | import { resolve } from 'node:path'; 7 | import { defineConfig } from 'vite'; 8 | 9 | export default defineConfig({ 10 | plugins: [ 11 | laravel({ 12 | input: ['resources/js/app.ts'], 13 | ssr: 'resources/js/ssr.ts', 14 | refresh: true, 15 | }), 16 | vue({ 17 | template: { 18 | transformAssetUrls: { 19 | base: null, 20 | includeAbsolute: false, 21 | }, 22 | }, 23 | }), 24 | ], 25 | resolve: { 26 | alias: { 27 | '@': path.resolve(__dirname, './resources/js'), 28 | 'ziggy-js': resolve(__dirname, 'vendor/tightenco/ziggy'), 29 | }, 30 | }, 31 | css: { 32 | postcss: { 33 | plugins: [tailwindcss, autoprefixer], 34 | }, 35 | }, 36 | }); 37 | --------------------------------------------------------------------------------