Migrations and factories

This commit is contained in:
2020-08-08 20:44:24 +05:00
parent c20392a24c
commit a587a25491
7 changed files with 188 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Article;
use App\Source;
use Faker\Generator as Faker;
$factory->define(Article::class, function (Faker $faker) {
return [
'title' => $faker->sentence,
'author' => $faker->name,
'featured_image' => "https://images-01.avas.mv/post/big_pUd28VpL9K3vQJjHbAZDYlaBl.jpg",
"body" => $faker->paragraph,
"source_id" => factory(App\Source::class),
"published_date" => $faker->dateTime,
];
});