Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/filament-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
13 changes: 13 additions & 0 deletions resources/lang/ru/filament-comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

return [
'comments' => 'Комментарии',
'comments.add' => 'Добавить комментарий',
'comments.empty' => 'Комментариев пока нет.',
'comments.placeholder' => 'Добавить комментарий...',

'notifications.created' => 'Комментарий добавлен.',
'notifications.deleted' => 'Комментарий удален.',

'modal.heading' => 'Комментарии',
];
13 changes: 13 additions & 0 deletions resources/lang/uk/filament-comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

return [
'comments' => 'Коментарі',
'comments.add' => 'Додати коментар',
'comments.empty' => 'Поки немає коментарів.',
'comments.placeholder' => 'Додати коментар...',

'notifications.created' => 'Коментар додано.',
'notifications.deleted' => 'Коментар видалено.',

'modal.heading' => 'Коментарі',
];
5 changes: 2 additions & 3 deletions src/Models/FilamentComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down