-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7fc049
commit 1415e03
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Modules/CodeTrek/Database/Seeders/CodeTrekApplicantsTableSeeder.php
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,24 @@ | ||
<?php | ||
|
||
namespace Modules\CodeTrek\Database\Seeders; | ||
|
||
use Illuminate\Database\Seeder; | ||
// use Illuminate\Database\Eloquent\Factories\Factory as EloquentFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
// use Modules\CodeTrek\Database\Factories\CodeTrekApplicantFactory; | ||
use Modules\CodeTrek\Entities\CodeTrekApplicant; | ||
|
||
class CodeTrekApplicantsTableSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
// Model::unguard(); | ||
|
||
CodeTrekApplicant::factory()->count(50)->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
37 changes: 37 additions & 0 deletions
37
Modules/CodeTrek/Database/factories/CodeTrekApplicantFactory.php
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,37 @@ | ||
<?php | ||
|
||
namespace Modules\CodeTrek\Database\Factories; | ||
|
||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Modules\CodeTrek\Entities\CodeTrekApplicant; | ||
|
||
class CodeTrekApplicantFactory extends Factory | ||
{ | ||
/** | ||
* The name of the factory's corresponding model. | ||
* | ||
* @var string | ||
*/ | ||
protected $model = CodeTrekApplicant::class; | ||
|
||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array | ||
*/ | ||
public function definition() | ||
{ | ||
return [ | ||
'first_name' => $this->faker->firstName, | ||
'last_name' => $this->faker->lastName, | ||
'email' => $this->faker->unique()->safeEmail, | ||
'github_user_name' => $this->faker->userName, | ||
'phone' => $this->faker->phoneNumber, | ||
'status' => 'active', | ||
'course' => $this->faker->randomElement(['Computer Science', 'Engineering', 'Mathematics']), | ||
'start_date' => $this->faker->date(), | ||
'graduation_year' => $this->faker->year, | ||
'university' => $this->faker->company, | ||
]; | ||
} | ||
} |
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