HovedprosjektWebApp/database/factories/BlogPostFactory.php

18 lines
450 B
PHP
Raw Normal View History

<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\BlogPost;
use Faker\Generator as Faker;
2020-03-09 11:47:30 +01:00
use DavidBadura\FakerMarkdownGenerator\FakerProvider as FakerMarkdownProvider;
$factory->define(BlogPost::class, function (Faker $faker) {
2020-03-09 11:47:30 +01:00
$mdProvider = new FakerMarkdownProvider($faker);
$faker->addProvider($mdProvider);
return [
2020-03-09 11:47:30 +01:00
'title' => $faker->realText(80),
'body' => $faker->markdown(),
];
});