31 lines
574 B
PHP
31 lines
574 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SystemNotificationCampaign extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['audience' => 'array', 'completed_at' => 'datetime'];
|
|
}
|
|
|
|
public function tenant()
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
public function notifications()
|
|
{
|
|
return $this->hasMany(UserNotification::class);
|
|
}
|
|
}
|