e13df69885
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
38 lines
968 B
PHP
38 lines
968 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class PrintRequest extends BaseModel
|
|
{
|
|
protected $table = 'print_requests';
|
|
|
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
|
public $timestamps = true;
|
|
|
|
protected $fillable = ['teacher_id', 'admin_id', 'class_id', 'file_path', 'page_selection', 'num_copies', 'required_by', 'pickup_method', 'status', 'created_at', 'updated_at'];
|
|
|
|
protected $casts = [
|
|
'teacher_id' => 'integer',
|
|
'admin_id' => 'integer',
|
|
'class_id' => 'integer',
|
|
'num_copies' => 'integer',
|
|
'required_by' => 'datetime', // if stored as DATETIME
|
|
];
|
|
|
|
/* Optional relationships */
|
|
public function teacher()
|
|
{
|
|
return $this->belongsTo(User::class, 'teacher_id');
|
|
}
|
|
|
|
public function admin()
|
|
{
|
|
return $this->belongsTo(User::class, 'admin_id');
|
|
}
|
|
|
|
public function schoolClass()
|
|
{
|
|
return $this->belongsTo(SchoolClass::class, 'class_id');
|
|
}
|
|
}
|