public function run() { $faker = Faker::create(); foreach (range(1, 10) as $index) { Car::create([]); } }
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; }
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]); } }
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]); }