123456789101112131415161718192021222324252627282930 |
- <?php
- /*
- * This file is part of the Jiannei/lumen-api-starter.
- *
- * (c) Jiannei <longjian.huang@foxmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- namespace Database\Factories;
- use App\Repositories\Models\Post;
- use Illuminate\Database\Eloquent\Factories\Factory;
- class PostFactory extends Factory
- {
- protected $model = Post::class;
- public function definition()
- {
- return [
- 'title' => $this->faker->sentence,
- 'body' => $this->faker->paragraph(3),
- 'published' => $this->faker->numberBetween(0, 1),
- 'user_id' => $this->faker->randomElement([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
- ];
- }
- }
|