Final changes
This commit is contained in:
@@ -10,6 +10,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use League\CommonMark\GithubFlavoredMarkdownConverter;
|
||||
use Spatie\Activitylog\Models\Concerns\LogsActivity;
|
||||
use Spatie\Activitylog\Support\LogOptions;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
@@ -61,7 +63,7 @@ use League\CommonMark\GithubFlavoredMarkdownConverter;
|
||||
class News extends Model
|
||||
{
|
||||
|
||||
use SoftDeletes, HasGallery, HasXenforoUserId;
|
||||
use SoftDeletes, HasGallery, HasXenforoUserId, LogsActivity;
|
||||
|
||||
protected $table = 'news';
|
||||
|
||||
@@ -127,4 +129,14 @@ class News extends Model
|
||||
return EntryHelpers::getYoutubeVideoId( $this->youtube_link );
|
||||
}
|
||||
|
||||
public function getActivitylogOptions(): LogOptions
|
||||
{
|
||||
return LogOptions::defaults()
|
||||
->useLogName('news')
|
||||
->logAll()
|
||||
->logOnlyDirty()
|
||||
->dontLogEmptyChanges()
|
||||
->setDescriptionForEvent(fn(string $eventName) => "News {$eventName}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user