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
inspect(Model>|string $model, string|null $connection = null)
Extract model details for the given model.
Collection<int,array<string,mixed>>
getVirtualAttributes(Model $model, array $columns)
Get the virtual (non-column) attributes for the given model.
Collection>
getBuilder($model)
No description
Model>
qualifyModel(string $model)
Qualify the given model class base name.
string|null
bool
mixed|null
getColumnDefault(array<string,mixed> $column, Model $model)
Get the default value for the given column.
bool
columnIsUnique(string $column, array $indexes)
Determine if the given attribute is unique.
Details
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>
getCollectedBy(Model $model)
Get the collection class being used by the model.
protected string|null
getCastType(string $column, Model $model)
Get the cast type for the given column.
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.