diff --git a/app/Models/User.php b/app/Models/User.php index e6862e8..527f0e2 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -14,10 +14,12 @@ namespace App\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; +use ApiPlatform\Metadata\ApiResource; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +#[ApiResource] class User extends Authenticatable { use HasFactory; @@ -40,7 +42,8 @@ class User extends Authenticatable * @var list */ protected $hidden = [ - 'password', + //TODO (Vincent A.): password creation handle + //'password', 'remember_token', ]; diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 05fb5d9..0b396f7 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -11,13 +11,15 @@ */ public function up(): void { - Schema::create('users', function (Blueprint $table) { + Schema::create('user', function (Blueprint $table) { $table->id(); - $table->string('name'); - $table->string('email')->unique(); - $table->timestamp('email_verified_at')->nullable(); - $table->string('password'); - $table->rememberToken(); + + $table->string('isbn')->nullable(); + $table->string('title'); + $table->text('description'); + $table->string('author'); + $table->date('publication_date')->nullable(); + $table->timestamps(); }); diff --git a/database/migrations/2025_02_04_152223_create_notifications_table.php b/database/migrations/2025_02_04_152223_create_notifications_table.php new file mode 100644 index 0000000..d738032 --- /dev/null +++ b/database/migrations/2025_02_04_152223_create_notifications_table.php @@ -0,0 +1,31 @@ +uuid('id')->primary(); + $table->string('type'); + $table->morphs('notifiable'); + $table->text('data'); + $table->timestamp('read_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('notifications'); + } +};