Skip to content

Instantly share code, notes, and snippets.

@andyyou
andyyou / Markdium-Hack.php
Last active Oct 28, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Hack.php
<?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;
@andyyou
andyyou / Markdium-Hack.php
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Hack.php
// app/Actions/Fortify/UpdateUserProfileInformaiton.php
['required', 'email', 'max:255', 'unique:users,email,NULL,id,deleted_at,NULL'],
// ...
])->validateWithBag('updateProfileInformation');
// ...
}
// ...
}
@andyyou
andyyou / Markdium-Hack.php
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Hack.php
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']);
});
}
@andyyou
andyyou / Markdium-Shell.sh
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Shell.sh
$ php artisan migrate
@andyyou
andyyou / Markdium-Hack.php
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Hack.php
'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'],
@andyyou
andyyou / Markdium-Shell.sh
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Shell.sh
$ laravel new demo
@andyyou
andyyou / Markdium-Hack.php
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Hack.php
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');
@andyyou
andyyou / Markdium-Hack.php
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Hack.php
use Illuminate\Database\Eloquent\SoftDeletes;
// ...
// If you want to support verify you can add implements
class User extends Authenticatable
{
use Notifiable;
use SoftDeletes;
// ...
@andyyou
andyyou / Markdium-Shell.sh
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Shell.sh
$ createdb demo
@andyyou
andyyou / Markdium-Shell.sh
Created Oct 23, 2020
Markdium-Laravel 8 - Integrate Jetstream + Socialite in 30 mins
View Markdium-Shell.sh
$ composer require laravel/jetstream
$ php artisan jetstream:install inertia --teams
$ npm install && npm run dev
# (opt) For customize template you should publish these views
$ php artisan vendor:publish --tag=jetstream-views