37 lines
718 B
PHP
37 lines
718 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class NotificationPreference extends Model
|
|
{
|
|
protected $fillable = [
|
|
'user_id',
|
|
'project_id',
|
|
'email_enabled',
|
|
'database_enabled',
|
|
'muted',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'email_enabled' => 'boolean',
|
|
'database_enabled' => 'boolean',
|
|
'muted' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function project(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Project::class);
|
|
}
|
|
}
|