本文整理汇总了PHP中Car::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Car::create方法的具体用法?PHP Car::create怎么用?PHP Car::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Car
的用法示例。
在下文中一共展示了Car::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
Car::create([]);
}
}
示例2: createCar
function createCar()
{
$request = Slim\Slim::getInstance()->request();
$car = json_decode($request->getBody());
$car = Car::create(['users_idU' => 1, 'modelC' => $car->modelC, 'brandC' => $car->brandC, 'registrationC' => $car->registrationC]);
echo $car;
}
示例3: run
public function run()
{
$faker = Faker::create();
Car::truncate();
foreach (range(1, 11) as $index) {
Car::create(['user_id' => $index, 'mark' => $faker->word, 'model' => $faker->word, 'year' => $faker->hexcolor, 'color' => $faker->colorName, 'transmission' => $faker->word, 'body' => $faker->word, 'number' => $faker->word]);
}
}
示例4: entry
private function entry($role, $customer, $start, $end)
{
$catalog = Catalog::create(array('title' => $role . ' - ' . $customer, 'description' => '', 'user_id' => 1, 'tags' => ''));
Car::create(['role' => $role, 'customer' => $customer, 'start' => $start, 'end' => $end, 'main_pic' => '', 'catalog_id' => $catalog->id, 'user_id' => 1]);
}