jonnybarnes.uk/database/factories/MediaFactory.php

33 lines
694 B
PHP
Raw Normal View History

<?php
namespace Database\Factories;
use App\Models\Media;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class MediaFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Media::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'path' => 'media/' . $this->faker->uuid . '.jpg',
'type' => 'image',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
}
}