mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-13 05:26:47 +00:00
38 lines
828 B
PHP
38 lines
828 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\NewsCategory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Spatie\MediaLibrary\HasMedia;
|
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
|
|
|
class Notification extends Model implements HasMedia
|
|
{
|
|
use InteractsWithMedia;
|
|
|
|
protected $guarded = [];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'category' => NewsCategory::class,
|
|
];
|
|
}
|
|
|
|
public function registerMediaCollections(): void
|
|
{
|
|
$this
|
|
->addMediaCollection('pdf')
|
|
->acceptsMimeTypes(['application/pdf'])
|
|
->singleFile()
|
|
->useDisk('private');
|
|
}
|
|
|
|
public function einundzwanzigPleb(): BelongsTo
|
|
{
|
|
return $this->belongsTo(EinundzwanzigPleb::class);
|
|
}
|
|
}
|