xmrmemes/database/factories/MemeFactory.php
2021-07-15 23:35:54 -07:00

36 lines
745 B
PHP

<?php
namespace Database\Factories;
use App\Models\Meme;
use App\Models\User;
use App\Models\Address;
use Illuminate\Database\Eloquent\Factories\Factory;
class MemeFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Meme::class;
private static $address_id = 1;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'user_id' => User::all()->random()->id,
'address_id' => self::$address_id++,
'title' => $this->faker->sentence($nbWords = 3, $variableNbWords = true),
'image' => 'blah.png',
];
}
}