mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use App\Models\Client;
|
|
use App\Models\MasterTask;
|
|
use App\Models\Project;
|
|
use App\Models\Team;
|
|
use App\Models\Timeblock;
|
|
use App\Models\Timesheet;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed the application's database.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
Client::factory()
|
|
->count(20)
|
|
->create();
|
|
|
|
Project::factory()
|
|
->hasClient()
|
|
->count(20)
|
|
->create();
|
|
|
|
for ($i=0; $i < 5; $i++) {
|
|
Team::factory()
|
|
->hasUsers(random_int(2, 5))
|
|
->create();
|
|
}
|
|
|
|
for ($i=0; $i < 30; $i++) {
|
|
MasterTask::factory()
|
|
->hasAttachments(random_int(0, 3))
|
|
->hasSubTasks(random_int(3, 5))
|
|
->create();
|
|
}
|
|
|
|
for ($i=0; $i < 30; $i++) {
|
|
Timeblock::factory()
|
|
->count(random_int(1, 2))
|
|
->create();
|
|
}
|
|
|
|
for ($i=0; $i < 30; $i++) {
|
|
Timesheet::factory()
|
|
->count(random_int(1, 2))
|
|
->create();
|
|
}
|
|
}
|
|
}
|