На данный момент это решило мою проблему
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Carbon\Carbon;
use App\Patient as pat;
class Patient extends Model
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'nom', 'id_pat', 'nom_epouse','prenom','sexe','date_de_naissance','etat_civil','id_chicha','id_tab','id_alc','id_neffa','id_autres',
];
protected $table="patients";
public static function getAge($pat)
{
return Carbon::parse($pat->date_de_naissance)->diffInYears(Carbon::now());
}
}