trait HasFactory (View source)

Methods

static TFactory
factory(callable(array<string, mixed>, static|null): array<string, mixed>|array<string, mixed>|int|null $count = null, callable(array<string, mixed>, static|null): array<string, mixed>|array<string, mixed> $state = [])

Get a new factory instance for the model.

static TFactory|null
newFactory()

Create a new factory instance for the model.

static TFactory|null
getUseFactoryAttribute()

Get the factory from the UseFactory class attribute.

Details

static TFactory factory(callable(array<string, mixed>, static|null): array<string, mixed>|array<string, mixed>|int|null $count = null, callable(array<string, mixed>, static|null): array<string, mixed>|array<string, mixed> $state = [])

Get a new factory instance for the model.

Parameters

callable(array<string, mixed>, static|null): array<string, mixed>|array<string, mixed>|int|null $count
callable(array<string, mixed>, static|null): array<string, mixed>|array<string, mixed> $state

Return Value

TFactory

static protected TFactory|null newFactory()

Create a new factory instance for the model.

Return Value

TFactory|null

static protected TFactory|null getUseFactoryAttribute()

Get the factory from the UseFactory class attribute.

Return Value

TFactory|null

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.