db:seed cleanup

This commit is contained in:
StudioTem committed 2023-01-24 21:54:03 +01:00
1 parent 33499107b7
commit dfac41f30a
9 files changed
+75 -18

No files matched your search

+11 -1
View File
@@ -4,6 +4,7 @@ namespace Database\Factories;
use App\Models\Client;
use App\Models\Project;
use App\Models\Team;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
@@ -18,10 +19,19 @@ class MasterTaskFactory extends Factory
*/
public function definition()
{
$project = Project::factory()->create();
// if (Project::all()->count() === 0) {
// $project = Project::factory()->create();
// } else {
// $project = Project::all()->random();
// }
$project = Project::all()->random();
$team = Team::all()->random();
return [
'project_id' => $project->id,
'team_id' => $team->id,
'title' => 'Master task ' . fake()->words(2, true),
'estimated_time' => fake()->numberBetween(20,100),
'tracked_time' => fake()->numberBetween(4,20),