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 43
__construct(Application $app)
Create a new model inspector instance.
at line 55
ModelInfo
inspect(string $model, string|null $connection = null)
Extract model details for the given model.
at line 88
protected Collection
getAttributes(Model $model)
Get the column attributes for the given model.
at line 118
protected Collection
getVirtualAttributes(Model $model, array $columns)
Get the virtual (non-column) attributes for the given model.
at line 158
protected Collection
getRelations(Model $model)
Get the relations from the given model.
at line 207
protected string|null
getPolicy(Model $model)
Get the first policy associated with this model.
at line 219
protected Collection
getEvents(Model $model)
Get the events that the model dispatches.
at line 236
protected Collection
getObservers(Model $model)
Get the observers watching this model.
at line 269
protected string
getCollectedBy(Model $model)
Get the collection class being used by the model.
at line 279
protected string
getBuilder(Model $model)
Get the builder class being used by the model.
at line 289
protected string|null
getResource(Model $model)
Get the class used for JSON response transforming.
at line 301
protected string
qualifyModel(string $model)
Qualify the given model class base name.
at line 325
protected string|null
getCastType(string $column, Model $model)
Get the cast type for the given column.
at line 343
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.