-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Employer seeder scaffolding using make:seeder. $ sail artisan make:seeder EmployerSeeder INFO Seeder [database/seeders/EmployerSeeder.php] created successfully. Build Employer seeder by using Employer factory. Update Job seeder and Database seeder accordingly. Now we can seed employers table individually. At the same time seeding all the tables works as before.
- Loading branch information
Showing
3 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ public function run(): void | |
'email' => '[email protected]', | ||
]); | ||
|
||
$this->call(EmployerSeeder::class); | ||
$this->call(JobSeeder::class); | ||
$this->call(TagSeeder::class); | ||
$this->call(JobTagSeeder::class); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use App\Models\Employer; | ||
use Illuminate\Database\Seeder; | ||
|
||
class EmployerSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void | ||
{ | ||
Employer::factory(10)->create(); | ||
} | ||
} |
This file contains 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