38 |
39 |
--------------------------------------------------------------------------------
/app/Models/User.php:
--------------------------------------------------------------------------------
1 | 'datetime',
51 | ];
52 |
53 | /**
54 | * The accessors to append to the model's array form.
55 | *
56 | * @var array
57 | */
58 | protected $appends = [
59 | 'profile_photo_url',
60 | ];
61 | }
62 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | configureRateLimiting();
30 |
31 | $this->routes(function () {
32 | Route::middleware('api')
33 | ->prefix('api')
34 | ->group(base_path('routes/api.php'));
35 |
36 | Route::middleware('web')
37 | ->group(base_path('routes/web.php'));
38 | });
39 | }
40 |
41 | /**
42 | * Configure the rate limiters for the application.
43 | *
44 | * @return void
45 | */
46 | protected function configureRateLimiting()
47 | {
48 | RateLimiter::for('api', function (Request $request) {
49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
50 | });
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Providers/FortifyServiceProvider.php:
--------------------------------------------------------------------------------
1 | email;
41 |
42 | return Limit::perMinute(5)->by($email.$request->ip());
43 | });
44 |
45 | RateLimiter::for('two-factor', function (Request $request) {
46 | return Limit::perMinute(5)->by($request->session()->get('login.id'));
47 | });
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php:
--------------------------------------------------------------------------------
1 | text('two_factor_secret')
19 | ->after('password')
20 | ->nullable();
21 |
22 | $table->text('two_factor_recovery_codes')
23 | ->after('two_factor_secret')
24 | ->nullable();
25 |
26 | if (Fortify::confirmsTwoFactorAuthentication()) {
27 | $table->timestamp('two_factor_confirmed_at')
28 | ->after('two_factor_recovery_codes')
29 | ->nullable();
30 | }
31 | });
32 | }
33 |
34 | /**
35 | * Reverse the migrations.
36 | *
37 | * @return void
38 | */
39 | public function down()
40 | {
41 | Schema::table('users', function (Blueprint $table) {
42 | $table->dropColumn(array_merge([
43 | 'two_factor_secret',
44 | 'two_factor_recovery_codes',
45 | ], Fortify::confirmsTwoFactorAuthentication() ? [
46 | 'two_factor_confirmed_at',
47 | ] : []));
48 | });
49 | }
50 | };
51 |
--------------------------------------------------------------------------------
/tests/Feature/RegistrationTest.php:
--------------------------------------------------------------------------------
1 | markTestSkipped('Registration support is not enabled.');
19 | }
20 |
21 | $response = $this->get('/register');
22 |
23 | $response->assertStatus(200);
24 | }
25 |
26 | public function test_registration_screen_cannot_be_rendered_if_support_is_disabled()
27 | {
28 | if (Features::enabled(Features::registration())) {
29 | return $this->markTestSkipped('Registration support is enabled.');
30 | }
31 |
32 | $response = $this->get('/register');
33 |
34 | $response->assertStatus(404);
35 | }
36 |
37 | public function test_new_users_can_register()
38 | {
39 | if (! Features::enabled(Features::registration())) {
40 | return $this->markTestSkipped('Registration support is not enabled.');
41 | }
42 |
43 | $response = $this->post('/register', [
44 | 'name' => 'Test User',
45 | 'email' => 'test@example.com',
46 | 'password' => 'password',
47 | 'password_confirmation' => 'password',
48 | 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature(),
49 | ]);
50 |
51 | $this->assertAuthenticated();
52 | $response->assertRedirect(RouteServiceProvider::HOME);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 65536,
48 | 'threads' => 1,
49 | 'time' => 4,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/tests/Feature/UpdatePasswordTest.php:
--------------------------------------------------------------------------------
1 | actingAs($user = User::factory()->create());
17 |
18 | $response = $this->put('/user/password', [
19 | 'current_password' => 'password',
20 | 'password' => 'new-password',
21 | 'password_confirmation' => 'new-password',
22 | ]);
23 |
24 | $this->assertTrue(Hash::check('new-password', $user->fresh()->password));
25 | }
26 |
27 | public function test_current_password_must_be_correct()
28 | {
29 | $this->actingAs($user = User::factory()->create());
30 |
31 | $response = $this->put('/user/password', [
32 | 'current_password' => 'wrong-password',
33 | 'password' => 'new-password',
34 | 'password_confirmation' => 'new-password',
35 | ]);
36 |
37 | $response->assertSessionHasErrors();
38 |
39 | $this->assertTrue(Hash::check('password', $user->fresh()->password));
40 | }
41 |
42 | public function test_new_passwords_must_match()
43 | {
44 | $this->actingAs($user = User::factory()->create());
45 |
46 | $response = $this->put('/user/password', [
47 | 'current_password' => 'password',
48 | 'password' => 'new-password',
49 | 'password_confirmation' => 'wrong-password',
50 | ]);
51 |
52 | $response->assertSessionHasErrors();
53 |
54 | $this->assertTrue(Hash::check('password', $user->fresh()->password));
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/tests/Feature/TwoFactorAuthenticationSettingsTest.php:
--------------------------------------------------------------------------------
1 | actingAs($user = User::factory()->create());
16 |
17 | $this->withSession(['auth.password_confirmed_at' => time()]);
18 |
19 | $response = $this->post('/user/two-factor-authentication');
20 |
21 | $this->assertNotNull($user->fresh()->two_factor_secret);
22 | $this->assertCount(8, $user->fresh()->recoveryCodes());
23 | }
24 |
25 | public function test_recovery_codes_can_be_regenerated()
26 | {
27 | $this->actingAs($user = User::factory()->create());
28 |
29 | $this->withSession(['auth.password_confirmed_at' => time()]);
30 |
31 | $this->post('/user/two-factor-authentication');
32 | $this->post('/user/two-factor-recovery-codes');
33 |
34 | $user = $user->fresh();
35 |
36 | $this->post('/user/two-factor-recovery-codes');
37 |
38 | $this->assertCount(8, $user->recoveryCodes());
39 | $this->assertCount(8, array_diff($user->recoveryCodes(), $user->fresh()->recoveryCodes()));
40 | }
41 |
42 | public function test_two_factor_authentication_can_be_disabled()
43 | {
44 | $this->actingAs($user = User::factory()->create());
45 |
46 | $this->withSession(['auth.password_confirmed_at' => time()]);
47 |
48 | $this->post('/user/two-factor-authentication');
49 |
50 | $this->assertNotNull($user->fresh()->two_factor_secret);
51 |
52 | $this->delete('/user/two-factor-authentication');
53 |
54 | $this->assertNull($user->fresh()->two_factor_secret);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class);
50 |
51 | $response = $kernel->handle(
52 | $request = Request::capture()
53 | )->send();
54 |
55 | $kernel->terminate($request, $response);
56 |
--------------------------------------------------------------------------------
/app/Actions/Fortify/UpdateUserProfileInformation.php:
--------------------------------------------------------------------------------
1 | ['required', 'string', 'max:255'],
23 | 'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
24 | 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
25 | ])->validateWithBag('updateProfileInformation');
26 |
27 | if (isset($input['photo'])) {
28 | $user->updateProfilePhoto($input['photo']);
29 | }
30 |
31 | if ($input['email'] !== $user->email &&
32 | $user instanceof MustVerifyEmail) {
33 | $this->updateVerifiedUser($user, $input);
34 | } else {
35 | $user->forceFill([
36 | 'name' => $input['name'],
37 | 'email' => $input['email'],
38 | ])->save();
39 | }
40 | }
41 |
42 | /**
43 | * Update the given verified user's profile information.
44 | *
45 | * @param mixed $user
46 | * @param array $input
47 | * @return void
48 | */
49 | protected function updateVerifiedUser($user, array $input)
50 | {
51 | $user->forceFill([
52 | 'name' => $input['name'],
53 | 'email' => $input['email'],
54 | 'email_verified_at' => null,
55 | ])->save();
56 |
57 | $user->sendEmailVerificationNotification();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | $this->faker->name(),
29 | 'email' => $this->faker->unique()->safeEmail(),
30 | 'email_verified_at' => now(),
31 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
32 | 'remember_token' => Str::random(10),
33 | ];
34 | }
35 |
36 | /**
37 | * Indicate that the model's email address should be unverified.
38 | *
39 | * @return \Illuminate\Database\Eloquent\Factories\Factory
40 | */
41 | public function unverified()
42 | {
43 | return $this->state(function (array $attributes) {
44 | return [
45 | 'email_verified_at' => null,
46 | ];
47 | });
48 | }
49 |
50 | /**
51 | * Indicate that the user should have a personal team.
52 | *
53 | * @return $this
54 | */
55 | public function withPersonalTeam()
56 | {
57 | if (! Features::hasTeamFeatures()) {
58 | return $this->state([]);
59 | }
60 |
61 | return $this->has(
62 | Team::factory()
63 | ->state(function (array $attributes, User $user) {
64 | return ['name' => $user->name.'\'s Team', 'user_id' => $user->id, 'personal_team' => true];
65 | }),
66 | 'ownedTeams'
67 | );
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/VerifyEmail.vue:
--------------------------------------------------------------------------------
1 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.
31 |
32 |
33 |
34 | A new verification link has been sent to the email address you provided during registration.
35 |
36 |
37 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Laravel FilePond Jetstream Vue Inertia Example
2 |
3 | Demo project to show how to use Rahul Haque's [Laravel Filepond](https://github.com/rahulhaque/laravel-filepond) package in Laravel Jetstream Vue Inertia project. Jump to the implementation directly by opening below files or install locally to tinker with various options.
4 | - [./resources/js/Pages/Dashboard.vue](resources/js/Pages/Dashboard.vue) - frontend logic.
5 | - [./app/Http/Middleware/HandleInertiaRequests.php](app/Http/Middleware/HandleInertiaRequests.php) - csrf token share.
6 | - [./routes/web.php](routes/web.php) - backend logic.
7 |
8 | ## Requirements
9 |
10 | - PHP8 or greater
11 | - MySQL
12 | - Composer
13 | - Npm
14 |
15 | ## Installation
16 |
17 | ```bash
18 | # Clone or download the repo
19 | git clone https://github.com/rahulhaque/laravel-filepond-vue-inertia-example
20 |
21 | # `cd` into the project directory
22 | cd laravel-filepond-vue-inertia-example
23 |
24 | # Copy `.env.example` file as `.env`
25 | # Edit `.env` variables if required
26 | # Create a database named `laravel_filepond_vue_inertia_example`
27 | cp .env.example .env
28 |
29 | # Install packages
30 | composer install
31 |
32 | # Generate application key file
33 | php artisan key:generate
34 |
35 | # Install npm packages
36 | npm install && npm run dev
37 |
38 | # Migrate the database
39 | php artisan migrate --seed
40 |
41 | # Start the server
42 | php artisan serve
43 | ```
44 |
45 | ## Authentication
46 |
47 | Visit [http://localhost:8000/login](http://localhost:8000/login)
48 |
49 | Default user info.
50 | - Email: admin@email.com
51 | - Password: password
52 |
53 | ## References
54 |
55 | - [FilePond](https://pqina.nl/filepond/)
56 | - [Laravel Filepond](https://github.com/rahulhaque/laravel-filepond)
57 |
58 | ## Contributing
59 |
60 | Any code improvement contribution or suggestions are welcome.
61 |
62 | ## Credits
63 |
64 | - [Rahul Haque](https://github.com/rahulhaque)
65 | - [All Contributors](../../contributors)
66 |
67 | ## License
68 |
69 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
70 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/ForgotPassword.vue:
--------------------------------------------------------------------------------
1 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.
33 |
49 |
50 | Please confirm access to your account by entering the authentication code provided by your authenticator application.
51 |
52 |
53 |
54 | Please confirm access to your account by entering one of your emergency recovery codes.
55 |
56 |
57 |
58 |
59 |
60 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | | Supported drivers: "apc", "array", "database", "file",
30 | | "memcached", "redis", "dynamodb", "octane", "null"
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | 'serialize' => false,
43 | ],
44 |
45 | 'database' => [
46 | 'driver' => 'database',
47 | 'table' => 'cache',
48 | 'connection' => null,
49 | 'lock_connection' => null,
50 | ],
51 |
52 | 'file' => [
53 | 'driver' => 'file',
54 | 'path' => storage_path('framework/cache/data'),
55 | ],
56 |
57 | 'memcached' => [
58 | 'driver' => 'memcached',
59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
60 | 'sasl' => [
61 | env('MEMCACHED_USERNAME'),
62 | env('MEMCACHED_PASSWORD'),
63 | ],
64 | 'options' => [
65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
66 | ],
67 | 'servers' => [
68 | [
69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
70 | 'port' => env('MEMCACHED_PORT', 11211),
71 | 'weight' => 100,
72 | ],
73 | ],
74 | ],
75 |
76 | 'redis' => [
77 | 'driver' => 'redis',
78 | 'connection' => 'cache',
79 | 'lock_connection' => 'default',
80 | ],
81 |
82 | 'dynamodb' => [
83 | 'driver' => 'dynamodb',
84 | 'key' => env('AWS_ACCESS_KEY_ID'),
85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
88 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
89 | ],
90 |
91 | 'octane' => [
92 | 'driver' => 'octane',
93 | ],
94 |
95 | ],
96 |
97 | /*
98 | |--------------------------------------------------------------------------
99 | | Cache Key Prefix
100 | |--------------------------------------------------------------------------
101 | |
102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache
103 | | stores there might be other applications using the same cache. For
104 | | that reason, you may prefix every cache key to avoid collisions.
105 | |
106 | */
107 |
108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
109 |
110 | ];
111 |
--------------------------------------------------------------------------------
/config/filepond.php:
--------------------------------------------------------------------------------
1 | env('FILEPOND_DISK', 'public'),
13 |
14 | /*
15 | |--------------------------------------------------------------------------
16 | | FilePond Temporary Disk
17 | |--------------------------------------------------------------------------
18 | |
19 | | Set the FilePond temporary disk and folder name to be used for temporary
20 | | storage. This disk will be used for temporary file storage and cleared
21 | | upon running the "artisan filepond:clear" command. It is recommended to
22 | | use local disk for temporary storage when you want to take advantage of
23 | | controller level validation. File validation from third party storage is
24 | | not yet supported. However, global 'validation_rules' defined in this
25 | | config will work fine.
26 | |
27 | */
28 | 'temp_disk' => 'local',
29 | 'temp_folder' => 'filepond/temp',
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | FilePond Routes Middleware
34 | |--------------------------------------------------------------------------
35 | |
36 | | Default middleware for FilePond routes.
37 | |
38 | */
39 | 'middleware' => [
40 | 'web', 'auth',
41 | ],
42 |
43 | /*
44 | |--------------------------------------------------------------------------
45 | | Soft Delete FilePond Model
46 | |--------------------------------------------------------------------------
47 | |
48 | | Determine whether to enable or disable soft delete in FilePond model.
49 | |
50 | */
51 | 'soft_delete' => false,
52 |
53 | /*
54 | |--------------------------------------------------------------------------
55 | | File Delete After (Minutes)
56 | |--------------------------------------------------------------------------
57 | |
58 | | Set the minutes after which the FilePond temporary storage files will be
59 | | deleted while running 'artisan filepond:clear' command.
60 | |
61 | */
62 | 'expiration' => 30,
63 |
64 | /*
65 | |--------------------------------------------------------------------------
66 | | FilePond Controller
67 | |--------------------------------------------------------------------------
68 | |
69 | | FilePond controller determines how the requests from FilePond library is
70 | | processed.
71 | |
72 | */
73 | 'controller' => RahulHaque\Filepond\Http\Controllers\FilepondController::class,
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Global Validation Rules
78 | |--------------------------------------------------------------------------
79 | |
80 | | Set the default validation for filepond's ./process route. In other words
81 | | temporary file upload validation.
82 | |
83 | */
84 | 'validation_rules' => [
85 | 'required',
86 | 'file',
87 | 'max:5000',
88 | ],
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | FilePond Server Paths
93 | |--------------------------------------------------------------------------
94 | |
95 | | Configure url for each of the FilePond actions.
96 | | See details - https://pqina.nl/filepond/docs/patterns/api/server/
97 | |
98 | */
99 | 'server' => [
100 | 'url' => env('FILEPOND_URL', '/filepond'),
101 | ],
102 | ];
103 |
--------------------------------------------------------------------------------
/resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue:
--------------------------------------------------------------------------------
1 |
39 |
40 |
41 |
42 |
43 | Update Password
44 |
45 |
46 |
47 | Ensure your account is using a long, random password to stay secure.
48 |
49 |
50 |
51 |
52 | Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.
53 |
54 |
55 |
56 |
57 | Delete Account
58 |
59 |
60 |
61 |
62 |
63 |
64 | Delete Account
65 |
66 |
67 |
68 | Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.
69 |
70 |
71 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | Cancel
87 |
88 |
89 |
95 | Delete Account
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'smtp'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Mailer Configurations
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure all of the mailers used by your application plus
24 | | their respective settings. Several examples have been configured for
25 | | you and you are free to add your own as your application requires.
26 | |
27 | | Laravel supports a variety of mail "transport" drivers to be used while
28 | | sending an e-mail. You will specify which one you are using for your
29 | | mailers below. You are free to add additional mailers as required.
30 | |
31 | | Supported: "smtp", "sendmail", "mailgun", "ses",
32 | | "postmark", "log", "array", "failover"
33 | |
34 | */
35 |
36 | 'mailers' => [
37 | 'smtp' => [
38 | 'transport' => 'smtp',
39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
40 | 'port' => env('MAIL_PORT', 587),
41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
42 | 'username' => env('MAIL_USERNAME'),
43 | 'password' => env('MAIL_PASSWORD'),
44 | 'timeout' => null,
45 | ],
46 |
47 | 'ses' => [
48 | 'transport' => 'ses',
49 | ],
50 |
51 | 'mailgun' => [
52 | 'transport' => 'mailgun',
53 | ],
54 |
55 | 'postmark' => [
56 | 'transport' => 'postmark',
57 | ],
58 |
59 | 'sendmail' => [
60 | 'transport' => 'sendmail',
61 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
62 | ],
63 |
64 | 'log' => [
65 | 'transport' => 'log',
66 | 'channel' => env('MAIL_LOG_CHANNEL'),
67 | ],
68 |
69 | 'array' => [
70 | 'transport' => 'array',
71 | ],
72 |
73 | 'failover' => [
74 | 'transport' => 'failover',
75 | 'mailers' => [
76 | 'smtp',
77 | 'log',
78 | ],
79 | ],
80 | ],
81 |
82 | /*
83 | |--------------------------------------------------------------------------
84 | | Global "From" Address
85 | |--------------------------------------------------------------------------
86 | |
87 | | You may wish for all e-mails sent by your application to be sent from
88 | | the same address. Here, you may specify a name and address that is
89 | | used globally for all e-mails that are sent by your application.
90 | |
91 | */
92 |
93 | 'from' => [
94 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
95 | 'name' => env('MAIL_FROM_NAME', 'Example'),
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Markdown Mail Settings
101 | |--------------------------------------------------------------------------
102 | |
103 | | If you are using Markdown based email rendering, you may configure your
104 | | theme and component paths here, allowing you to customize the design
105 | | of the emails. Or, you may simply stick with the Laravel defaults!
106 | |
107 | */
108 |
109 | 'markdown' => [
110 | 'theme' => 'default',
111 |
112 | 'paths' => [
113 | resource_path('views/vendor/mail'),
114 | ],
115 | ],
116 |
117 | ];
118 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 | ],
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | User Providers
48 | |--------------------------------------------------------------------------
49 | |
50 | | All authentication drivers have a user provider. This defines how the
51 | | users are actually retrieved out of your database or other storage
52 | | mechanisms used by this application to persist your user's data.
53 | |
54 | | If you have multiple user tables or models you may configure multiple
55 | | sources which represent each model / table. These sources may then
56 | | be assigned to any extra authentication guards you have defined.
57 | |
58 | | Supported: "database", "eloquent"
59 | |
60 | */
61 |
62 | 'providers' => [
63 | 'users' => [
64 | 'driver' => 'eloquent',
65 | 'model' => App\Models\User::class,
66 | ],
67 |
68 | // 'users' => [
69 | // 'driver' => 'database',
70 | // 'table' => 'users',
71 | // ],
72 | ],
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Resetting Passwords
77 | |--------------------------------------------------------------------------
78 | |
79 | | You may specify multiple password reset configurations if you have more
80 | | than one user table or model in the application and you want to have
81 | | separate password reset settings based on the specific user types.
82 | |
83 | | The expire time is the number of minutes that each reset token will be
84 | | considered valid. This security feature keeps tokens short-lived so
85 | | they have less time to be guessed. You may change this as needed.
86 | |
87 | */
88 |
89 | 'passwords' => [
90 | 'users' => [
91 | 'provider' => 'users',
92 | 'table' => 'password_resets',
93 | 'expire' => 60,
94 | 'throttle' => 60,
95 | ],
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Password Confirmation Timeout
101 | |--------------------------------------------------------------------------
102 | |
103 | | Here you may define the amount of seconds before a password confirmation
104 | | times out and the user is prompted to re-enter their password via the
105 | | confirmation screen. By default, the timeout lasts for three hours.
106 | |
107 | */
108 |
109 | 'password_timeout' => 10800,
110 |
111 | ];
112 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Deprecations Log Channel
25 | |--------------------------------------------------------------------------
26 | |
27 | | This option controls the log channel that should be used to log warnings
28 | | regarding deprecated PHP and library features. This allows you to get
29 | | your application ready for upcoming major versions of dependencies.
30 | |
31 | */
32 |
33 | 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Log Channels
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may configure the log channels for your application. Out of
41 | | the box, Laravel uses the Monolog PHP logging library. This gives
42 | | you a variety of powerful log handlers / formatters to utilize.
43 | |
44 | | Available Drivers: "single", "daily", "slack", "syslog",
45 | | "errorlog", "monolog",
46 | | "custom", "stack"
47 | |
48 | */
49 |
50 | 'channels' => [
51 | 'stack' => [
52 | 'driver' => 'stack',
53 | 'channels' => ['single'],
54 | 'ignore_exceptions' => false,
55 | ],
56 |
57 | 'single' => [
58 | 'driver' => 'single',
59 | 'path' => storage_path('logs/laravel.log'),
60 | 'level' => env('LOG_LEVEL', 'debug'),
61 | ],
62 |
63 | 'daily' => [
64 | 'driver' => 'daily',
65 | 'path' => storage_path('logs/laravel.log'),
66 | 'level' => env('LOG_LEVEL', 'debug'),
67 | 'days' => 14,
68 | ],
69 |
70 | 'slack' => [
71 | 'driver' => 'slack',
72 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
73 | 'username' => 'Laravel Log',
74 | 'emoji' => ':boom:',
75 | 'level' => env('LOG_LEVEL', 'critical'),
76 | ],
77 |
78 | 'papertrail' => [
79 | 'driver' => 'monolog',
80 | 'level' => env('LOG_LEVEL', 'debug'),
81 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
82 | 'handler_with' => [
83 | 'host' => env('PAPERTRAIL_URL'),
84 | 'port' => env('PAPERTRAIL_PORT'),
85 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
86 | ],
87 | ],
88 |
89 | 'stderr' => [
90 | 'driver' => 'monolog',
91 | 'level' => env('LOG_LEVEL', 'debug'),
92 | 'handler' => StreamHandler::class,
93 | 'formatter' => env('LOG_STDERR_FORMATTER'),
94 | 'with' => [
95 | 'stream' => 'php://stderr',
96 | ],
97 | ],
98 |
99 | 'syslog' => [
100 | 'driver' => 'syslog',
101 | 'level' => env('LOG_LEVEL', 'debug'),
102 | ],
103 |
104 | 'errorlog' => [
105 | 'driver' => 'errorlog',
106 | 'level' => env('LOG_LEVEL', 'debug'),
107 | ],
108 |
109 | 'null' => [
110 | 'driver' => 'monolog',
111 | 'handler' => NullHandler::class,
112 | ],
113 |
114 | 'emergency' => [
115 | 'path' => storage_path('logs/laravel.log'),
116 | ],
117 | ],
118 |
119 | ];
120 |
--------------------------------------------------------------------------------
/resources/js/Jetstream/Banner.vue:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
32 |
33 |
48 |
49 |
50 |
51 | {{ message }}
52 |
53 |
54 |
55 |
56 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/Register.vue:
--------------------------------------------------------------------------------
1 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/config/fortify.php:
--------------------------------------------------------------------------------
1 | 'web',
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Fortify Password Broker
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may specify which password broker Fortify can use when a user
27 | | is resetting their password. This configured value should match one
28 | | of your password brokers setup in your "auth" configuration file.
29 | |
30 | */
31 |
32 | 'passwords' => 'users',
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | Username / Email
37 | |--------------------------------------------------------------------------
38 | |
39 | | This value defines which model attribute should be considered as your
40 | | application's "username" field. Typically, this might be the email
41 | | address of the users but you are free to change this value here.
42 | |
43 | | Out of the box, Fortify expects forgot password and reset password
44 | | requests to have a field named 'email'. If the application uses
45 | | another name for the field you may define it below as needed.
46 | |
47 | */
48 |
49 | 'username' => 'email',
50 |
51 | 'email' => 'email',
52 |
53 | /*
54 | |--------------------------------------------------------------------------
55 | | Home Path
56 | |--------------------------------------------------------------------------
57 | |
58 | | Here you may configure the path where users will get redirected during
59 | | authentication or password reset when the operations are successful
60 | | and the user is authenticated. You are free to change this value.
61 | |
62 | */
63 |
64 | 'home' => RouteServiceProvider::HOME,
65 |
66 | /*
67 | |--------------------------------------------------------------------------
68 | | Fortify Routes Prefix / Subdomain
69 | |--------------------------------------------------------------------------
70 | |
71 | | Here you may specify which prefix Fortify will assign to all the routes
72 | | that it registers with the application. If necessary, you may change
73 | | subdomain under which all of the Fortify routes will be available.
74 | |
75 | */
76 |
77 | 'prefix' => '',
78 |
79 | 'domain' => null,
80 |
81 | /*
82 | |--------------------------------------------------------------------------
83 | | Fortify Routes Middleware
84 | |--------------------------------------------------------------------------
85 | |
86 | | Here you may specify which middleware Fortify will assign to the routes
87 | | that it registers with the application. If necessary, you may change
88 | | these middleware but typically this provided default is preferred.
89 | |
90 | */
91 |
92 | 'middleware' => ['web'],
93 |
94 | /*
95 | |--------------------------------------------------------------------------
96 | | Rate Limiting
97 | |--------------------------------------------------------------------------
98 | |
99 | | By default, Fortify will throttle logins to five requests per minute for
100 | | every email and IP address combination. However, if you would like to
101 | | specify a custom rate limiter to call then you may specify it here.
102 | |
103 | */
104 |
105 | 'limiters' => [
106 | 'login' => 'login',
107 | 'two-factor' => 'two-factor',
108 | ],
109 |
110 | /*
111 | |--------------------------------------------------------------------------
112 | | Register View Routes
113 | |--------------------------------------------------------------------------
114 | |
115 | | Here you may specify if the routes returning views should be disabled as
116 | | you may not need them when building your own application. This may be
117 | | especially true if you're writing a custom single-page application.
118 | |
119 | */
120 |
121 | 'views' => true,
122 |
123 | /*
124 | |--------------------------------------------------------------------------
125 | | Features
126 | |--------------------------------------------------------------------------
127 | |
128 | | Some of the Fortify features are optional. You may disable the features
129 | | by removing them from this array. You're free to only remove some of
130 | | these features or you can even remove all of these if you need to.
131 | |
132 | */
133 |
134 | 'features' => [
135 | Features::registration(),
136 | Features::resetPasswords(),
137 | // Features::emailVerification(),
138 | Features::updateProfileInformation(),
139 | Features::updatePasswords(),
140 | Features::twoFactorAuthentication([
141 | 'confirm' => true,
142 | 'confirmPassword' => true,
143 | ]),
144 | ],
145 |
146 | ];
147 |
--------------------------------------------------------------------------------
/resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue:
--------------------------------------------------------------------------------
1 |
73 |
74 |
75 |
76 |
77 | Profile Information
78 |
79 |
80 |
81 | Update your account's profile information and email address.
82 |
83 |
84 |
85 |
86 |