Created
March 14, 2020 13:35
-
-
Save palypster/b9dab1975ca0a021eea01404c52e8400 to your computer and use it in GitHub Desktop.
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 | |
use App\Client; | |
use App\Project; | |
use Faker\Generator as Faker; | |
$factory->define(Project::class, function (Faker $faker) { | |
return [ | |
'title' => $faker->sentence, | |
]; | |
}); | |
$factory->afterMakingState(Project::class, 'reuse', function (Project $project, $faker) { | |
$project->client_id = Client::query()->inRandomOrder()->first()->getKey(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment