From fdeef97616ec29584f98ecc9c8915adc972881e8 Mon Sep 17 00:00:00 2001 From: gigabyte_tech Date: Tue, 6 Feb 2024 11:50:57 +0200 Subject: [PATCH 1/3] added authenticatable model class in config file --- config/filament-comments.php | 5 +++++ src/Models/FilamentComment.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/filament-comments.php b/config/filament-comments.php index 8b6fbd8..57c7aa5 100644 --- a/config/filament-comments.php +++ b/config/filament-comments.php @@ -48,4 +48,9 @@ * The attribute used to display the user's name. */ 'user_name_attribute' => 'name', + + /* + * Authenticatable model class + */ + 'authenticatable' => \App\Models\User::class, ]; diff --git a/src/Models/FilamentComment.php b/src/Models/FilamentComment.php index a304152..bc0d51a 100644 --- a/src/Models/FilamentComment.php +++ b/src/Models/FilamentComment.php @@ -23,9 +23,9 @@ class FilamentComment extends Model public function user(): BelongsTo { - $authenticatable = app(Authenticatable::class); + $authenticatable = config('filament-comments.authenticatable'); - return $this->belongsTo($authenticatable::class, 'user_id'); + return $this->belongsTo($authenticatable, 'user_id'); } public function subject(): BelongsTo From 7b29cbf657a11f43abbfb11c2eef319bc87efc10 Mon Sep 17 00:00:00 2001 From: gigabyte_tech Date: Tue, 6 Feb 2024 12:00:24 +0200 Subject: [PATCH 2/3] cleaned code --- src/Models/FilamentComment.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Models/FilamentComment.php b/src/Models/FilamentComment.php index bc0d51a..e99832b 100644 --- a/src/Models/FilamentComment.php +++ b/src/Models/FilamentComment.php @@ -2,7 +2,6 @@ namespace Parallax\FilamentComments\Models; -use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\MassPrunable; use Illuminate\Database\Eloquent\Model; From 85faa5a43923f7c299430242c3ab26881a09e6c4 Mon Sep 17 00:00:00 2001 From: gigabyte_tech Date: Tue, 6 Feb 2024 12:39:29 +0200 Subject: [PATCH 3/3] adds ukrainian an russian translation file --- resources/lang/ru/filament-comments.php | 13 +++++++++++++ resources/lang/uk/filament-comments.php | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 resources/lang/ru/filament-comments.php create mode 100644 resources/lang/uk/filament-comments.php diff --git a/resources/lang/ru/filament-comments.php b/resources/lang/ru/filament-comments.php new file mode 100644 index 0000000..45c2f66 --- /dev/null +++ b/resources/lang/ru/filament-comments.php @@ -0,0 +1,13 @@ + 'Комментарии', + 'comments.add' => 'Добавить комментарий', + 'comments.empty' => 'Комментариев пока нет.', + 'comments.placeholder' => 'Добавить комментарий...', + + 'notifications.created' => 'Комментарий добавлен.', + 'notifications.deleted' => 'Комментарий удален.', + + 'modal.heading' => 'Комментарии', +]; diff --git a/resources/lang/uk/filament-comments.php b/resources/lang/uk/filament-comments.php new file mode 100644 index 0000000..e3e192c --- /dev/null +++ b/resources/lang/uk/filament-comments.php @@ -0,0 +1,13 @@ + 'Коментарі', + 'comments.add' => 'Додати коментар', + 'comments.empty' => 'Поки немає коментарів.', + 'comments.placeholder' => 'Додати коментар...', + + 'notifications.created' => 'Коментар додано.', + 'notifications.deleted' => 'Коментар видалено.', + + 'modal.heading' => 'Коментарі', +];