diff options
Diffstat (limited to 'database/factories')
-rw-r--r-- | database/factories/PostFactory.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/database/factories/PostFactory.php b/database/factories/PostFactory.php new file mode 100644 index 0000000..0b00530 --- /dev/null +++ b/database/factories/PostFactory.php @@ -0,0 +1,30 @@ +<?php + +namespace Database\Factories; + +use App\Models\Post; +use Illuminate\Database\Eloquent\Factories\Factory; + +class PostFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Post::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'title' => $this->faker->title, + 'author' => $this->faker->name, + 'text' => $this->faker->text, + ]; + } +} |