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 46
__construct(Application $app)
Create a new model inspector instance.
at line 58
ModelInfo
inspect(string $model, string|null $connection = null)
Extract model details for the given model.
at line 91
protected Collection
getAttributes(Model $model)
Get the column attributes for the given model.
at line 121
protected Collection
getVirtualAttributes(Model $model, array $columns)
Get the virtual (non-column) attributes for the given model.
at line 161
protected Collection
getRelations(Model $model)
Get the relations from the given model.
at line 210
protected string|null
getPolicy(Model $model)
Get the first policy associated with this model.
at line 222
protected Collection
getEvents(Model $model)
Get the events that the model dispatches.
at line 238
protected Collection
getObservers(Model $model)
Get the observers watching this model.
at line 271
protected string
getCollectedBy(Model $model)
Get the collection class being used by the model.
at line 281
protected string
getBuilder(Model $model)
Get the builder class being used by the model.
at line 291
protected string|null
getResource(Model $model)
Get the class used for JSON response transforming.
at line 303
protected string
qualifyModel(string $model)
Qualify the given model class base name.
at line 327
protected string|null
getCastType(string $column, Model $model)
Get the cast type for the given column.
at line 345
protected Collection
getCastsWithDates(Model $model)
Get the model casts, including any date casts.
at line 357
protected bool
attributeIsHidden(string $attribute, Model $model)
Determine if the given attribute is hidden.
at line 373
protected mixed
getColumnDefault(array $column, Model $model)
Get the default value for the given column.
at line 383
protected bool
columnIsUnique(string $column, array $indexes)
Determine if the given attribute is unique.