database/factories/WorkerFactory.php
/**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
Define the model's default state.
@return array
Define the model ' s default state . @return array
public function definition()
    {
        return [
            'name' => $this->faker->firstName,
            'surname' => $this->faker->lastName,
            'department' => $this->faker->randomElement(['IT', 'HR', 'Sales']),
            'salary' => $this->faker->numberBetween(1000, 3000),
        ];
    }
public function definition ( ) { return [ 'name' => $ this -> faker -> firstName , 'surname' => $ this -> faker -> lastName , 'department' => $ this -> faker -> randomElement ( [ 'IT' , 'HR' , 'Sales' ] ) , 'salary' => $ this -> faker -> numberBetween ( 1000 , 3000 ) , ] ; }
Define the model's default state.
Define the model ' s default state .