27 lines
505 B
PHP
27 lines
505 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Disease extends Model
|
|
{
|
|
protected $fillable = [
|
|
'code',
|
|
'name',
|
|
'latin_name',
|
|
'description',
|
|
'photo',
|
|
];
|
|
|
|
public function symptoms()
|
|
{
|
|
return $this->belongsToMany(Symptom::class, 'disease_symptoms')
|
|
->withPivot('cf_value');
|
|
}
|
|
|
|
public function treatments()
|
|
{
|
|
return $this->hasMany(Treatment::class)->orderBy('order');
|
|
}
|
|
} |