39 lines
738 B
PHP
39 lines
738 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\MaterielType;
|
|
use EloquentFilter\Filterable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Materiel extends Model
|
|
{
|
|
use Filterable, HasFactory;
|
|
|
|
protected $casts = [
|
|
'type' => MaterielType::class,
|
|
];
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'type',
|
|
'year',
|
|
'quarter',
|
|
'lowest_price',
|
|
'highest_price',
|
|
'created_by',
|
|
'updated_by',
|
|
];
|
|
|
|
public function createdBy()
|
|
{
|
|
return $this->belongsTo(AdminUser::class, 'created_by');
|
|
}
|
|
|
|
public function updatedBy()
|
|
{
|
|
return $this->belongsTo(AdminUser::class, 'updated_by');
|
|
}
|
|
}
|