Change your name, email and password here.
16 | 19 |A new feature will come here.
28 | 31 |A new feature will come here.
37 | 40 |
20 |
21 | Credentials:
22 | Email: mail@sreejith.co
23 | Password: Pa$$w0rd!
24 |
25 | - [Laravel](https://laravel.com/docs/9.x)
26 | - [inertia.js](https://inertiajs.com)
27 | - [Vue.js](https://vuejs.org/guide/introduction.html)
28 | - [Vuex](https://vuex.vuejs.org)
29 | - [Bootstrap](https://getbootstrap.com/docs/5.1)
30 |
31 | ## Installation
32 |
33 | Clone the repository.
34 |
35 | `$ git clone git@github.com:SreejithEzhakkad/laravel-vue-inertia-bootstrap-app.git`
36 |
37 | Create a MySQL database. Copy `.env.example` to `.env` and change values.
38 | Do the following
39 |
40 | `$ composer install`
41 |
42 | `$ npm install`
43 |
44 | `$ npm run production`
45 |
46 | `$ php artisan migrate`
47 |
48 | `$ php artisan serve`
49 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DISK', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Filesystem Disks
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure as many filesystem "disks" as you wish, and you
24 | | may even configure multiple disks of the same driver. Defaults have
25 | | been setup for each driver as an example of the required options.
26 | |
27 | | Supported Drivers: "local", "ftp", "sftp", "s3"
28 | |
29 | */
30 |
31 | 'disks' => [
32 |
33 | 'local' => [
34 | 'driver' => 'local',
35 | 'root' => storage_path('app'),
36 | ],
37 |
38 | 'public' => [
39 | 'driver' => 'local',
40 | 'root' => storage_path('app/public'),
41 | 'url' => env('APP_URL').'/storage',
42 | 'visibility' => 'public',
43 | ],
44 |
45 | 's3' => [
46 | 'driver' => 's3',
47 | 'key' => env('AWS_ACCESS_KEY_ID'),
48 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
49 | 'region' => env('AWS_DEFAULT_REGION'),
50 | 'bucket' => env('AWS_BUCKET'),
51 | 'url' => env('AWS_URL'),
52 | 'endpoint' => env('AWS_ENDPOINT'),
53 | ],
54 |
55 | ],
56 |
57 | /*
58 | |--------------------------------------------------------------------------
59 | | Symbolic Links
60 | |--------------------------------------------------------------------------
61 | |
62 | | Here you may configure the symbolic links that will be created when the
63 | | `storage:link` Artisan command is executed. The array keys should be
64 | | the locations of the links and the values should be their targets.
65 | |
66 | */
67 |
68 | 'links' => [
69 | public_path('storage') => storage_path('app/public'),
70 | ],
71 |
72 | ];
73 |
--------------------------------------------------------------------------------
/app/Http/Requests/Auth/LoginRequest.php:
--------------------------------------------------------------------------------
1 | 'required|string|email',
33 | 'password' => 'required|string',
34 | ];
35 | }
36 |
37 | /**
38 | * Attempt to authenticate the request's credentials.
39 | *
40 | * @return void
41 | *
42 | * @throws \Illuminate\Validation\ValidationException
43 | */
44 | public function authenticate()
45 | {
46 | $this->ensureIsNotRateLimited();
47 |
48 | if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
49 | RateLimiter::hit($this->throttleKey());
50 |
51 | throw ValidationException::withMessages([
52 | 'email' => __('auth.failed'),
53 | ]);
54 | }
55 |
56 | RateLimiter::clear($this->throttleKey());
57 | }
58 |
59 | /**
60 | * Ensure the login request is not rate limited.
61 | *
62 | * @return void
63 | *
64 | * @throws \Illuminate\Validation\ValidationException
65 | */
66 | public function ensureIsNotRateLimited()
67 | {
68 | if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
69 | return;
70 | }
71 |
72 | event(new Lockout($this));
73 |
74 | $seconds = RateLimiter::availableIn($this->throttleKey());
75 |
76 | throw ValidationException::withMessages([
77 | 'email' => trans('auth.throttle', [
78 | 'seconds' => $seconds,
79 | 'minutes' => ceil($seconds / 60),
80 | ]),
81 | ]);
82 | }
83 |
84 | /**
85 | * Get the rate limiting throttle key for the request.
86 | *
87 | * @return string
88 | */
89 | public function throttleKey()
90 | {
91 | return Str::lower($this->input('email')).'|'.$this->ip();
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
38 | \App\Http\Middleware\VerifyCsrfToken::class,
39 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
40 | \App\Http\Middleware\HandleInertiaRequests::class,
41 | ],
42 |
43 | 'api' => [
44 | 'throttle:api',
45 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
46 | ],
47 | ];
48 |
49 | /**
50 | * The application's route middleware.
51 | *
52 | * These middleware may be assigned to groups or used individually.
53 | *
54 | * @var array
55 | */
56 | protected $routeMiddleware = [
57 | 'auth' => \App\Http\Middleware\Authenticate::class,
58 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
63 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
66 | ];
67 | }
68 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/NewPasswordController.php:
--------------------------------------------------------------------------------
1 | $request->email,
27 | 'token' => $request->route('token'),
28 | ]);
29 | }
30 |
31 | /**
32 | * Handle an incoming new password request.
33 | *
34 | * @param \Illuminate\Http\Request $request
35 | * @return \Illuminate\Http\RedirectResponse
36 | *
37 | * @throws \Illuminate\Validation\ValidationException
38 | */
39 | public function store(Request $request)
40 | {
41 | $request->validate([
42 | 'token' => 'required',
43 | 'email' => 'required|email',
44 | 'password' => ['required', 'confirmed', Rules\Password::defaults()],
45 | ]);
46 |
47 | // Here we will attempt to reset the user's password. If it is successful we
48 | // will update the password on an actual user model and persist it to the
49 | // database. Otherwise we will parse the error and return the response.
50 | $status = Password::reset(
51 | $request->only('email', 'password', 'password_confirmation', 'token'),
52 | function ($user) use ($request) {
53 | $user->forceFill([
54 | 'password' => Hash::make($request->password),
55 | 'remember_token' => Str::random(60),
56 | ])->save();
57 |
58 | event(new PasswordReset($user));
59 | }
60 | );
61 |
62 | // If the password was successfully reset, we will redirect the user back to
63 | // the application's home authenticated view. If there is an error we can
64 | // redirect them back to where they came from with their error message.
65 | if ($status == Password::PASSWORD_RESET) {
66 | return redirect()->route('login')->with('status', __($status));
67 | }
68 |
69 | throw ValidationException::withMessages([
70 | 'email' => [trans($status)],
71 | ]);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/routes/auth.php:
--------------------------------------------------------------------------------
1 | middleware('guest')
15 | ->name('register');
16 |
17 | Route::post('/register', [RegisteredUserController::class, 'store'])
18 | ->middleware('guest');
19 |
20 | Route::get('/login', [AuthenticatedSessionController::class, 'create'])
21 | ->middleware('guest')
22 | ->name('login');
23 |
24 | Route::post('/login', [AuthenticatedSessionController::class, 'store'])
25 | ->middleware('guest');
26 |
27 | Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])
28 | ->middleware('guest')
29 | ->name('password.request');
30 |
31 | Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])
32 | ->middleware('guest')
33 | ->name('password.email');
34 |
35 | Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])
36 | ->middleware('guest')
37 | ->name('password.reset');
38 |
39 | Route::post('/reset-password', [NewPasswordController::class, 'store'])
40 | ->middleware('guest')
41 | ->name('password.update');
42 |
43 | Route::get('/verify-email', [EmailVerificationPromptController::class, '__invoke'])
44 | ->middleware('auth')
45 | ->name('verification.notice');
46 |
47 | Route::get('/verify-email/{id}/{hash}', [VerifyEmailController::class, '__invoke'])
48 | ->middleware(['auth', 'signed', 'throttle:6,1'])
49 | ->name('verification.verify');
50 |
51 | Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
52 | ->middleware(['auth', 'throttle:6,1'])
53 | ->name('verification.send');
54 |
55 | Route::get('/confirm-password', [ConfirmablePasswordController::class, 'show'])
56 | ->middleware('auth')
57 | ->name('password.confirm');
58 |
59 | Route::post('/confirm-password', [ConfirmablePasswordController::class, 'store'])
60 | ->middleware('auth');
61 |
62 | Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
63 | ->middleware('auth')
64 | ->name('logout');
65 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/VerifyEmail.vue:
--------------------------------------------------------------------------------
1 |
2 |
13 | 17 | This is a simple web application developed using 18 | Laravel 9, 24 | Vue.js 3(also 30 | Vuex 4), 36 | Inertia.js, and 42 | Bootstrap v5.1. This application includes authentication and a simple 48 | CRUD. 49 |
50 || # | 40 |First | 41 |Last | 42 |Manage | 43 |
|---|---|---|---|
| {{ contact.id }} | 48 |{{ contact.name }} | 49 |{{ contact.phone }} | 50 |
51 | |
57 |