36 lines
712 B
PHP
36 lines
712 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class NotificationPreference extends Model
|
||
|
|
{
|
||
|
|
use HasUuids;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'user_id',
|
||
|
|
'post_published',
|
||
|
|
'post_failed',
|
||
|
|
'account_disconnected',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected function casts(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'post_published' => 'boolean',
|
||
|
|
'post_failed' => 'boolean',
|
||
|
|
'account_disconnected' => 'boolean',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function user(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class);
|
||
|
|
}
|
||
|
|
}
|