24 lines
546 B
PHP
24 lines
546 B
PHP
<?php
|
|
|
|
namespace Modules\CRM\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|
|
|
final class Activity extends Model
|
|
{
|
|
protected $table = 'crm_activities';
|
|
|
|
protected $fillable = ['subject_type', 'subject_id', 'user_id', 'type', 'title', 'description', 'due_at', 'completed_at'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['due_at' => 'datetime', 'completed_at' => 'datetime'];
|
|
}
|
|
|
|
public function subject(): MorphTo
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|