Migrations and factories
This commit is contained in:
18
database/factories/ArticleFactory.php
Normal file
18
database/factories/ArticleFactory.php
Normal 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,
|
||||
];
|
||||
});
|
Reference in New Issue
Block a user