Add Passkey Support & Pint
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Episode;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Episode>
|
||||
* @extends Factory<Episode>
|
||||
*/
|
||||
class EpisodeFactory extends Factory
|
||||
{
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Hentai;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Hentai>
|
||||
* @extends Factory<Hentai>
|
||||
*/
|
||||
class HentaiFactory extends Factory
|
||||
{
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Studios;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Studios>
|
||||
* @extends Factory<Studios>
|
||||
*/
|
||||
class StudiosFactory extends Factory
|
||||
{
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
* @extends Factory<User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ return new class extends Migration
|
||||
|
||||
$alreadyexists = Episode::where('slug', $episode->slug)->first();
|
||||
if ($alreadyexists) {
|
||||
throw new \RuntimeException('Migration stopped! Slug already exists: '.$episode->slug);
|
||||
throw new RuntimeException('Migration stopped! Slug already exists: '.$episode->slug);
|
||||
}
|
||||
|
||||
$episode->save();
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Spatie\LaravelPasskeys\Support\Config;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$authenticatableClass = Config::getAuthenticatableModel();
|
||||
|
||||
$authenticatableTableName = (new $authenticatableClass)->getTable();
|
||||
|
||||
Schema::create('passkeys', function (Blueprint $table) use ($authenticatableTableName, $authenticatableClass) {
|
||||
$table->id();
|
||||
|
||||
$table
|
||||
->foreignIdFor($authenticatableClass, 'authenticatable_id')
|
||||
->constrained(table: $authenticatableTableName, indexName: 'passkeys_authenticatable_fk')
|
||||
->cascadeOnDelete();
|
||||
|
||||
$table->text('name');
|
||||
$table->text('credential_id');
|
||||
$table->json('data');
|
||||
|
||||
$table->timestamp('last_used_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user