View Markdium-Hack.php
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/CreateNewUser.php@create | |
// app/Actions/Fortify/UpdateUserProfileInformation.php@update | |
// unique rule | |
Validator::make($input, [ | |
'name' => ['required', 'string', 'max:255'], | |
'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email,NULL,id,deleted_at,NULL'], | |
'password' => $this->passwordRules(), | |
])->validate(); |
View Markdium-Hack.php
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/CreateNewUser.php | |
['required', 'string', 'email', 'max:255', 'unique:users,email,NULL,id,deleted_at,NULL'], | |
// ... | |
])->validate(); | |
return DB::transaction(function () use ($input) { | |
return tap(User::create([ | |
'name' => $input['name'], | |
'email' => $input['email'], | |
'password' => Hash::make($input['password']), |
View Markdium-Hack.php
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 | |
use Illuminate\Support\Facades\Route; | |
use App\Http\Controllers\Auth\LoginController; | |
// ... | |
Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () { | |
return Inertia\Inertia::render('Dashboard'); | |
})->name('dashboard'); |
View Markdium-Shell.sh
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 laravel/socialite | |
# (opt) If you meet memory limit error, place `COMPOSER_MEMORY_LIMIT=-1` before command | |
# $ COMPOSER_MEMORY_LIMIT=-1 composer require laravel/socialite |
View Markdium-Hack.php
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
<div> | |
@php | |
$providers = [ | |
'google' => [ | |
'bgColor' => '#ec462f', | |
'icon' => 'fab fa-google', | |
], | |
'facebook' => [ | |
'bgColor' => '#1877f2', | |
'icon' => 'fab fa-facebook-f', |
View Markdium-Shell.sh
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 make:controller Auth/LoginController |
View Markdium-Hack.php
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']); | |
}); | |
} |
View Markdium-Hack.php
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; | |
use SoftDeletes; | |
protected $casts = [ | |
'email_verified_at' => 'datetime', | |
'social' => 'array', | |
]; |
View Markdium-Shell.sh
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
# 1. Create project | |
$ laravel new demo | |
# 2. Install jetstream with teams | |
$ 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 |
View Markdium-JavaScript.js
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 |
NewerOlder