1. Go to this page and download the library: Download gurinder/laravel-auth library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gurinder / laravel-auth example snippets
Schema::create('users', function (Blueprint $table) {
...
$table->boolean('email_verified')->default(false);
$table->string('email_verification_token')->nullable();
...
});
return [
// Open or Close Registration
'registration_open' => true,
// Name fields to Register, make sure it matches with your user model
'registration_name_fields' => [
// 'name'
'first_name',
'last_name',
],
// validation rules for registeration
// Note: Do not delete data field, its r user is successfulle logged in
'redirect_path_after_login' => '/login-successful',
// Redirect path after user is successfulle reseted password
'redirect_path_after_password_reset' => '/password-reset-done',
// Redirect path after user registered and email confiremed via mail
'redirect_path_after_email_confirmation' => '/email-is-confirmed',
// User model must have a method $user->assignRole($roles)
// in order to this works
// And it must accept role slug, role id, roles array, role instance
// NOTE -> make sure this role exist in database
'default_roles' => ['subscriber'],
// Email configuration to send welcome and confirmation(email) emails to user
'email_from' => [
'name' => 'Gurinder Laravel Auth',
'email' => '[email protected]'
]
];