From dfc5afc24ca86b788b9b49d7cd66b346f3a13055 Mon Sep 17 00:00:00 2001 From: Flemming Petersen Date: Tue, 1 Aug 2023 20:12:30 +0200 Subject: [PATCH] chore: add filament notification --- app/Mail/ItemBorrowed.php | 2 +- composer.json | 4 ++- composer.lock | 2 +- ...8_01_180501_create_notifications_table.php | 31 +++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 database/migrations/2023_08_01_180501_create_notifications_table.php diff --git a/app/Mail/ItemBorrowed.php b/app/Mail/ItemBorrowed.php index 1e683d7..7e7ff21 100644 --- a/app/Mail/ItemBorrowed.php +++ b/app/Mail/ItemBorrowed.php @@ -29,7 +29,7 @@ public function __construct( public function envelope(): Envelope { return new Envelope( - subject: $this->item->name.'ausgeliehen', + subject: $this->item->name.' ausgeliehen', ); } diff --git a/composer.json b/composer.json index 70a2ba2..b6f4529 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "require": { "php": "^8.1", "filament/filament": "^3.0", + "filament/notifications": "^3.0", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.0", "laravel/sanctum": "^3.2", @@ -41,7 +42,8 @@ "scripts": { "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", - "@php artisan package:discover --ansi" + "@php artisan package:discover --ansi", + "@php artisan filament:upgrade" ], "post-update-cmd": [ "@php artisan vendor:publish --tag=laravel-assets --ansi --force", diff --git a/composer.lock b/composer.lock index 3bc4d5f..450f081 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "93b39142163401711e5947065c7d0310", + "content-hash": "8e4231f4bb1a0f956159f9c551c9264f", "packages": [ { "name": "blade-ui-kit/blade-heroicons", diff --git a/database/migrations/2023_08_01_180501_create_notifications_table.php b/database/migrations/2023_08_01_180501_create_notifications_table.php new file mode 100644 index 0000000..d738032 --- /dev/null +++ b/database/migrations/2023_08_01_180501_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'); + } +};