32 lines
863 B
PHP
32 lines
863 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\MealPosts;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class MealPostsFactory extends Factory
|
|
{
|
|
protected $model = MealPosts::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'image_url' => $this->faker->imageUrl(),
|
|
'caption' => $this->faker->word(),
|
|
'calories' => $this->faker->randomNumber(),
|
|
'proteins' => $this->faker->randomFloat(),
|
|
'carbs' => $this->faker->randomFloat(),
|
|
'fats' => $this->faker->randomFloat(),
|
|
'title' => $this->faker->word(),
|
|
'eaten_at' => Carbon::now(),
|
|
'created_at' => Carbon::now(),
|
|
'updated_at' => Carbon::now(),
|
|
|
|
'user_id' => User::factory(),
|
|
];
|
|
}
|
|
}
|