27 lines
466 B
PHP
Executable File
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');
|
|
}
|
|
}
|