ModelInspector
class ModelInspector
Properties
| protected list<string> | $relationMethods | The methods that can be called in a model to indicate a relation. |
Methods
Extract model details for the given model.
Get the virtual (non-column) attributes for the given model.
Qualify the given model class base name.
Determine if the given attribute is unique.
Details
at line 45
__construct(Application $app)
Create a new model inspector instance.
at line 57
ModelInfo
inspect(string $model, string|null $connection = null)
Extract model details for the given model.
at line 90
protected Collection
getAttributes(Model $model)
Get the column attributes for the given model.
at line 120
protected Collection
getVirtualAttributes(Model $model, array $columns)
Get the virtual (non-column) attributes for the given model.
at line 160
protected Collection
getRelations(Model $model)
Get the relations from the given model.
at line 209
protected string|null
getPolicy(Model $model)
Get the first policy associated with this model.
at line 221
protected Collection
getEvents(Model $model)
Get the events that the model dispatches.
at line 237
protected Collection
getObservers(Model $model)
Get the observers watching this model.
at line 270
protected string
getCollectedBy(Model $model)
Get the collection class being used by the model.
at line 280
protected string
getBuilder(Model $model)
Get the builder class being used by the model.
at line 290
protected string|null
getResource(Model $model)
Get the class used for JSON response transforming.
at line 302
protected string
qualifyModel(string $model)
Qualify the given model class base name.
at line 326
protected string|null
getCastType(string $column, Model $model)
Get the cast type for the given column.
at line 344
protected Collection
getCastsWithDates(Model $model)
Get the model casts, including any date casts.
at line 356
protected bool
attributeIsHidden(string $attribute, Model $model)
Determine if the given attribute is hidden.
at line 372
protected mixed
getColumnDefault(array $column, Model $model)
Get the default value for the given column.
at line 382
protected bool
columnIsUnique(string $column, array $indexes)
Determine if the given attribute is unique.