Created
October 29, 2021 14:25
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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