mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
db:seed cleanup
This commit is contained in:
1 parent
33499107b7
commit
dfac41f30a
9 files changed
+75
-18
No files matched your search
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user