FactoryBuilder (Database\Eloquent)

FactoryBuilder

class FactoryBuilder (View source)

Methods

void __construct(string $class, string $name, array $definitions, array $states, Generator $faker)

Create an new builder instance.

$this times(int $amount)

Set the amount of models you wish to create / make.

$this states(array|dynamic $states)

Set the states to be applied to the model.

mixed create(array $attributes = array())

Create a collection of models and persist them to the database.

mixed make(array $attributes = array())

Create a collection of models.

Details

void __construct(string $class, string $name, array $definitions, array $states, Generator $faker)

Create an new builder instance.

Parameters

string $class
string $name
array $definitions
array $states
Generator $faker

Return Value

void

$this times(int $amount)

Set the amount of models you wish to create / make.

Parameters

int $amount

Return Value

$this

$this states(array|dynamic $states)

Set the states to be applied to the model.

Parameters

array|dynamic $states

Return Value

$this

mixed create(array $attributes = array())

Create a collection of models and persist them to the database.

Parameters

array $attributes

Return Value

mixed

mixed make(array $attributes = array())

Create a collection of models.

Parameters

array $attributes

Return Value

mixed

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Database/Eloquent/FactoryBuilder.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部