Static model configuration#
Model exposes these important static fields in the inspected source:
table: stringprimaryKey = "id"autoUuid = truetimestamps: boolean | string[] = truecasts: Record<string, CastType> = {}softDeletes = falsedeletedAtColumn = "deleted_at"hidden: string[] = []fillable: string[] = []guarded: string[] = []globalScopes
Static helpers#
The base model implements query, withTrashed, onlyTrashed, find, findOrFail, all, count, where, create, forceCreate, firstOrCreate, firstOrNew and updateOrCreate. The full source also contains attribute/fill/save/delete methods and relation helpers; consult the declaration shipped with the installed package for complete overloads.
Instance behavior#
Models keep current and original attributes for dirty tracking, support save() and serialize through toJSON(). A proxy enables direct attribute access. Internal properties beginning with _ and key model methods receive special handling, so avoid naming application attributes after internal model methods.
Mass assignment#
Use fillable as an allowlist or guarded as a denylist. Do not pass raw request objects directly into create() or fill(). Construct an explicit validated DTO before persistence.