This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require doctrine/dbal | |
$ php artisan make:migration edit_columns_in_users_table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Auth; | |
use App\Http\Controllers\Controller; | |
use App\Providers\RouteServiceProvider; | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Http\Request; | |
use Socialite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/Actions/Fortify/UpdateUserProfileInformaiton.php | |
['required', 'email', 'max:255', 'unique:users,email,NULL,id,deleted_at,NULL'], | |
// ... | |
])->validateWithBag('updateProfileInformation'); | |
// ... | |
} | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function up() | |
{ | |
Schema::table('users', function (Blueprint $table) { | |
$table->dropUnique(['email']); | |
$table->string('password')->nullable()->change(); | |
$table->json('social')->nullable(); | |
$table->softDeletes(); | |
$table->unique(['email', 'deleted_at']); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php artisan migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'ses' => [ | |
'key' => env('AWS_ACCESS_KEY_ID'), | |
'secret' => env('AWS_SECRET_ACCESS_KEY'), | |
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), | |
], | |
'facebook' => [ | |
'client_id' => env('FACEBOOK_CLIENT_ID'), | |
'client_secret' => env('FACEBOOK_CLIENT_SECRET'), | |
'redirect' => env('FACEBOOK_CALLBACK_URL'), | |
'scopes' => ['email', 'public_profile'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ laravel new demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use App\Http\Controllers\Auth\LoginController; | |
Route::get('/login/{provider}', [LoginController::class, 'redirectToProvider']) | |
->name('social.login'); | |
Route::get('/login/{provider}/callback', [LoginController::class, 'handleProviderCallback']) | |
->name('social.callback'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Illuminate\Database\Eloquent\SoftDeletes; | |
// ... | |
// If you want to support verify you can add implements | |
class User extends Authenticatable | |
{ | |
use Notifiable; | |
use SoftDeletes; | |
// ... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ createdb demo |