reconstruction of the project
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\BaseModel;
|
||||
|
||||
class CommunicationLog extends Model
|
||||
class CommunicationLog extends BaseModel
|
||||
{
|
||||
protected $table = 'communication_logs';
|
||||
|
||||
// CI model didn't enable timestamps; keep off unless your table has created_at/updated_at.
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'student_id',
|
||||
'family_id',
|
||||
@@ -23,5 +27,28 @@ class CommunicationLog extends Model
|
||||
'sent_by',
|
||||
'metadata',
|
||||
];
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'student_id' => 'integer',
|
||||
'family_id' => 'integer',
|
||||
'sent_by' => 'integer',
|
||||
|
||||
// If these columns are JSON in DB, this will auto convert to arrays
|
||||
'recipients' => 'array',
|
||||
'cc' => 'array',
|
||||
'bcc' => 'array',
|
||||
'attachments' => 'array',
|
||||
'metadata' => 'array',
|
||||
];
|
||||
|
||||
/* Optional relationships */
|
||||
public function student()
|
||||
{
|
||||
return $this->belongsTo(Student::class, 'student_id');
|
||||
}
|
||||
|
||||
public function sender()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'sent_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user