ModelInspector
class ModelInspector (View source)
Properties
protected Application | $app | The Laravel application instance. |
|
protected array<int,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.
No description
Qualify the given model class base name.
Get the default value for the given column.
Determine if the given attribute is unique.
Details
void
__construct(Application $app)
Create a new model inspector instance.
inspect(Model>|string $model, string|null $connection = null)
Extract model details for the given model.
protected Collection<int,array<string,mixed>>
getAttributes(Model $model)
Get the column attributes for the given model.
protected Collection
getVirtualAttributes(Model $model, array $columns)
Get the virtual (non-column) attributes for the given model.
protected Collection
getRelations(Model $model)
Get the relations from the given model.
protected string|null
getPolicy(Model $model)
Get the first policy associated with this model.
protected Collection
getEvents(Model $model)
Get the events that the model dispatches.
protected Collection
getObservers(Model $model)
Get the observers watching this model.
protected Collection>
getCollectedBy(Model $model)
Get the collection class being used by the model.
protected
getBuilder($model)
No description
protected Model>
qualifyModel(string $model)
Qualify the given model class base name.
protected string|null
getCastType(string $column, Model $model)
Get the cast type for the given column.
protected Collection
getCastsWithDates(Model $model)
Get the model casts, including any date casts.
protected bool
attributeIsHidden(string $attribute, Model $model)
Determine if the given attribute is hidden.
protected mixed|null
getColumnDefault(array<string,mixed> $column, Model $model)
Get the default value for the given column.
protected bool
columnIsUnique(string $column, array $indexes)
Determine if the given attribute is unique.