Skip to content

Instantly share code, notes, and snippets.

@NandoKstroNet
Created October 29, 2021 14:25
Show Gist options
  • Save NandoKstroNet/99bd3822389a1d6558132a0edfddab2c to your computer and use it in GitHub Desktop.
Save NandoKstroNet/99bd3822389a1d6558132a0edfddab2c to your computer and use it in GitHub Desktop.
Video Factory, segundo projeto bloco 2, do curso Laravel Mastery em https://laravelmastery.com.br
<?php
namespace Database\Factories;
use App\Models\Video;
use Illuminate\Database\Eloquent\Factories\Factory;
class VideoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Video::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$name = $this->faker->word;
return [
'name' => $name,
'description' => $this->faker->sentence,
'slug' => \Illuminate\Support\Str::slug($name),
'video' => 'video.m3ua',
'thumb' => $this->faker->imageUrl(640, 480)
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment