abstract class Seeder (View source)

Properties

protected Container $container

The container instance.

protected Command $command

The console command instance.

static protected array $called

Seeders that have been called at least one time.

Methods

$this
call(array|string $class, bool $silent = false, array $parameters = [])

Run the given seeder class.

void
callWith(array|string $class, array $parameters = [])

Run the given seeder class.

void
callSilent(array|string $class, array $parameters = [])

Silently run the given seeder class.

void
callOnce(array|string $class, bool $silent = false, array $parameters = [])

Run the given seeder class once.

resolve(string $class)

Resolve an instance of the given seeder class.

$this
setContainer(Container $container)

Set the IoC container instance.

$this
setCommand(Command $command)

Set the console command instance.

mixed
__invoke(array $parameters = [])

Run the database seeds.

Details

$this call(array|string $class, bool $silent = false, array $parameters = [])

Run the given seeder class.

Parameters

array|string $class
bool $silent
array $parameters

Return Value

$this

void callWith(array|string $class, array $parameters = [])

Run the given seeder class.

Parameters

array|string $class
array $parameters

Return Value

void

void callSilent(array|string $class, array $parameters = [])

Silently run the given seeder class.

Parameters

array|string $class
array $parameters

Return Value

void

void callOnce(array|string $class, bool $silent = false, array $parameters = [])

Run the given seeder class once.

Parameters

array|string $class
bool $silent
array $parameters

Return Value

void

protected Seeder resolve(string $class)

Resolve an instance of the given seeder class.

Parameters

string $class

Return Value

Seeder

$this setContainer(Container $container)

Set the IoC container instance.

Parameters

Container $container

Return Value

$this

$this setCommand(Command $command)

Set the console command instance.

Parameters

Command $command

Return Value

$this

mixed __invoke(array $parameters = [])

Run the database seeds.

Parameters

array $parameters

Return Value

mixed

Exceptions

InvalidArgumentException

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.