Last change
on this file since 28bab7b was e78295c, checked in by beratkjufliju <kufliju@…>, 3 years ago |
added version
|
-
Property mode
set to
100644
|
File size:
490 bytes
|
Rev | Line | |
---|
[c6b84df] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace Database\Seeders;
|
---|
| 4 |
|
---|
[4b7e2d3] | 5 | use App\Models\Department;
|
---|
[c6b84df] | 6 | use App\Models\Folder;
|
---|
| 7 | use Carbon\Carbon;
|
---|
| 8 | use Illuminate\Database\Seeder;
|
---|
| 9 |
|
---|
| 10 | class FoldersTableSeeder extends Seeder
|
---|
| 11 | {
|
---|
| 12 | /**
|
---|
| 13 | * Run the database seeds.
|
---|
| 14 | *
|
---|
| 15 | * @return void
|
---|
| 16 | */
|
---|
| 17 | public function run()
|
---|
| 18 | {
|
---|
[e78295c] | 19 | Folder::factory()->count(15)->create();
|
---|
[4b7e2d3] | 20 | $folders = Folder::all();
|
---|
| 21 |
|
---|
| 22 | foreach ($folders as $folder) {
|
---|
| 23 | $folder->department()->increment('no_of_folders');
|
---|
| 24 | }
|
---|
[c6b84df] | 25 | }
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.