first commit
This commit is contained in:
26
app/common/model/Report.php
Normal file
26
app/common/model/Report.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace app\common\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Report extends Model
|
||||
{
|
||||
protected $table = 'reports';
|
||||
protected $guarded = [];
|
||||
|
||||
// Cast JSON fields automatically
|
||||
protected $casts = [
|
||||
'flaws_json' => 'array',
|
||||
'images_json' => 'array',
|
||||
];
|
||||
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(Order::class, 'order_id');
|
||||
}
|
||||
|
||||
public function inspector()
|
||||
{
|
||||
return $this->belongsTo(AdminUser::class, 'inspector_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user