* fix css focuses * #90 - wip * #90 - fix to generate PDF * #90 - wip * #90 - wip * #90 - wip * #90 - wip * #90 - fix to calendar * #90 - wip * #90 - fix * #90 - fix lint * #90 - fix * Apply suggestions from code review Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com> * #90 - cr fixes * #90 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>
This commit is contained in:
@@ -5,10 +5,9 @@ declare(strict_types=1);
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
use Toby\Domain\Enums\EmploymentForm;
|
||||
use Toby\Domain\Enums\Role;
|
||||
use Toby\Eloquent\Models\Profile;
|
||||
use Toby\Eloquent\Models\User;
|
||||
|
||||
class UserFactory extends Factory
|
||||
@@ -18,17 +17,21 @@ class UserFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
"first_name" => $this->faker->firstName(),
|
||||
"last_name" => $this->faker->lastName(),
|
||||
"email" => $this->faker->unique()->safeEmail(),
|
||||
"employment_form" => $this->faker->randomElement(EmploymentForm::cases()),
|
||||
"position" => $this->faker->jobTitle(),
|
||||
"role" => Role::Employee,
|
||||
"employment_date" => Carbon::createFromInterface($this->faker->dateTimeBetween("2020-10-27"))->toDateString(),
|
||||
"remember_token" => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
public function configure(): self
|
||||
{
|
||||
return $this->afterCreating(function (User $user): void {
|
||||
if (!$user->profile()->exists()) {
|
||||
Profile::factory()->for($user)->create();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function admin(): static
|
||||
{
|
||||
return $this->state([
|
||||
|
Reference in New Issue
Block a user