abstract class Seeder

Properties

protected Container $container

The container instance.

protected Command $command

The console command instance.

static protected array<int, class-string> $called

Seeders that have been called at least one time.

Methods

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

Run the given seeder class.

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

Run the given seeder class.

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

Silently run the given seeder class.

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.

setContainer(Container $container)

Set the IoC container instance.

setCommand(Command $command)

Set the console command instance.

static void
flushState()

Flush all static state.

mixed
__invoke(array $parameters = [])

Run the database seeds.

Details

at line 38
Seeder call(array|string $class, bool $silent = false, array $parameters = [])

Run the given seeder class.

Parameters

array|string $class
bool $silent
array $parameters

Return Value

Seeder

at line 76
Seeder callWith(array|string $class, array $parameters = [])

Run the given seeder class.

Parameters

array|string $class
array $parameters

Return Value

Seeder

at line 86
Seeder callSilent(array|string $class, array $parameters = [])

Silently run the given seeder class.

Parameters

array|string $class
array $parameters

Return Value

Seeder

at line 96
Seeder 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

Seeder

at line 114
protected Seeder resolve(string $class)

Resolve an instance of the given seeder class.

Parameters

string $class

Return Value

Seeder

at line 136
Seeder setContainer(Container $container)

Set the IoC container instance.

Parameters

Container $container

Return Value

Seeder

at line 146
Seeder setCommand(Command $command)

Set the console command instance.

Parameters

Command $command

Return Value

Seeder

at line 156
static void flushState()

Flush all static state.

Return Value

void

at line 166
mixed __invoke(array $parameters = [])

Run the database seeds.

Parameters

array $parameters

Return Value

mixed

Exceptions

InvalidArgumentException