InteractsWithModels
trait InteractsWithModels (View source)
Methods
TModel|null
TModel
modelOrFail(string $key, TModel>|Closure|null $modelClass = null, Closure|null $callback = null)
Retrieve the model identified by the given input or throw an exception.
TModel>
TModel>
newModelQuery(string $key, TModel>|Closure|null $modelClass = null, Closure|null $callback = null)
Create a model query for the given input key.
Model>
guessModelClass(string $key)
Guess the model class for the given input key.
Details
TModel|null
model(string $key, TModel>|Closure|null $modelClass = null, Closure|null $callback = null)
Retrieve the model identified by the given input.
TModel
modelOrFail(string $key, TModel>|Closure|null $modelClass = null, Closure|null $callback = null)
Retrieve the model identified by the given input or throw an exception.
TModel>
models(string $key, TModel>|Closure|null $modelClass = null, Closure|null $callback = null)
Retrieve the models identified by the given input.
protected TModel>
newModelQuery(string $key, TModel>|Closure|null $modelClass = null, Closure|null $callback = null)
Create a model query for the given input key.
protected Model>
guessModelClass(string $key)
Guess the model class for the given input key.