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 ParentMeetingSchedule extends Model
|
||||
class ParentMeetingSchedule extends BaseModel
|
||||
{
|
||||
protected $table = 'parent_meeting_schedules';
|
||||
|
||||
// ✅ CI: useTimestamps = true (created_at/updated_at)
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = [
|
||||
'student_id',
|
||||
'parent_user_id',
|
||||
@@ -23,5 +27,31 @@ class ParentMeetingSchedule extends Model
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
public $timestamps = true;
|
||||
|
||||
protected $casts = [
|
||||
'student_id' => 'integer',
|
||||
'parent_user_id' => 'integer',
|
||||
'created_by' => 'integer',
|
||||
|
||||
// if these are DATE/TIME columns:
|
||||
'date' => 'date',
|
||||
// time is typically stored as TIME or string; keep as string unless DATETIME
|
||||
'time' => 'string',
|
||||
];
|
||||
|
||||
/* Optional relationships */
|
||||
public function student()
|
||||
{
|
||||
return $this->belongsTo(Student::class, 'student_id');
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'parent_user_id');
|
||||
}
|
||||
|
||||
public function creator()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user