34 lines
660 B
PHP
34 lines
660 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Ingredient\Models;
|
||
|
|
||
|
use App\Traits\StatusTrait;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Modules\Supplier\Models\Supplier;
|
||
|
|
||
|
class Ingredient extends Model
|
||
|
{
|
||
|
USE StatusTrait;
|
||
|
|
||
|
protected $table = 'tbl_ingredients';
|
||
|
protected $guarded = [];
|
||
|
protected $appends = ['status_name'];
|
||
|
|
||
|
|
||
|
public function category()
|
||
|
{
|
||
|
return $this->belongsTo(IngredientCategory::class, 'ingredient_category_id');
|
||
|
}
|
||
|
|
||
|
public function unit()
|
||
|
{
|
||
|
return $this->belongsTo(Unit::class, 'unit_id');
|
||
|
}
|
||
|
|
||
|
|
||
|
public function supplier()
|
||
|
{
|
||
|
return $this->belongsTo(Supplier::class, 'supplier_id');
|
||
|
}
|
||
|
}
|