Illuminate\Database\Eloquent\Model::load PHP Method

load() public method

Eager load relations on the model.
public load ( array | string $relations )
$relations array | string
    public function load($relations)
    {
        if (is_string($relations)) {
            $relations = func_get_args();
        }
        $query = $this->newQuery()->with($relations);
        $query->eagerLoadRelations([$this]);
        return $this;
    }

Usage Example

 public function apply(Model $model, Repository $repository)
 {
     return $model->load($this->relations);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::load
Model