Files
aso/app/Models/DrugCategory.php
2022-11-03 09:51:22 +07:00

27 lines
466 B
PHP
Executable File

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DrugCategory extends Model
{
use HasFactory;
protected $fillable = [
'drug_id',
'category_id'
];
public function drug()
{
return $this->belongsTo(Drug::class, 'drug_id');
}
public function category()
{
return $this->belongsTo(Category::class, 'category_id');
}
}