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/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' => 'Коментарі', +]; diff --git a/src/Models/FilamentComment.php b/src/Models/FilamentComment.php index a304152..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; @@ -23,9 +22,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