Answers for "how to call a model inside the same model laravel"

PHP
0

laravel use model inside blade

AppModelsModelName::ClassName('parameter');
Posted by: Guest on March-16-2021
0

laravel find model inside the same model

class Instrument extends Model
{
  protected $appends = ['benchmark'];
  
  public function getBenchmarkAttribute()
  {
    // this is equivalent to Instrument::find($this->benchmark_id)
    return self::find($this->benchmark_id);
  }
}
Posted by: Guest on January-22-2021

Code answers related to "how to call a model inside the same model laravel"

Browse Popular Code Answers by Language