69 行
1.5 KiB
PHP
69 行
1.5 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use \App\Models\Admin;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
// class AdminFactory extends Factory
|
|
// {
|
|
// /**
|
|
// * The name of the factory's corresponding model.
|
|
// *
|
|
// * @var string
|
|
// */
|
|
// protected $model = Model::class;
|
|
|
|
// /**
|
|
// * Define the model's default state.
|
|
// *
|
|
// * @return array
|
|
// */
|
|
// public function definition()
|
|
// {
|
|
// return [
|
|
// //
|
|
// ];
|
|
// }
|
|
// }
|
|
|
|
// use Faker\Generator as Faker;
|
|
|
|
// $factory->define(Admin::class, function (Faker $faker){
|
|
// return[
|
|
// 'id' => $this->faker->name,
|
|
// 'email' => $this->faker->name,
|
|
// 'password' => $this->faker->name,
|
|
// 'remember_token' => $this->faker->name,
|
|
// 'created_at' => $this->faker->name,
|
|
// 'updated_at' => $this->faker->name,
|
|
// ];
|
|
// });
|
|
|
|
class AdminFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Admin::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
return [
|
|
'id' => $this->faker->numberBetween,
|
|
'email' => $this->faker->email,
|
|
'password' => $this->faker->password,
|
|
'remember_token' => $this->faker->password,
|
|
'created_at' => $this->faker->dateTime,
|
|
'updated_at' => $this->faker->dateTime,
|
|
];
|
|
}
|
|
}
|