Files
alrahma_sunday_school_api/app/Models/PrintRequest.php
T
root 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
fix unittests issues
2026-07-07 20:56:32 -04:00

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');
}
}