mirror of
https://github.com/Aviortheking/CA_LARAVEL.git
synced 2025-06-20 21:09:17 +00:00
fix migration && add seeder && add is_admin
This commit is contained in:
67
database/seeds/CreateUsersSeeder.php
Normal file
67
database/seeds/CreateUsersSeeder.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
use App\User;
|
||||
|
||||
|
||||
|
||||
class CreateUsersSeeder extends Seeder
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
* Run the database seeds.
|
||||
|
||||
*
|
||||
|
||||
* @return void
|
||||
|
||||
*/
|
||||
|
||||
public function run()
|
||||
|
||||
{
|
||||
|
||||
$user = [
|
||||
|
||||
[
|
||||
|
||||
'name'=>'Admin',
|
||||
|
||||
'email'=>'admin@admin.fr',
|
||||
|
||||
'is_admin'=>'1',
|
||||
|
||||
'password'=> bcrypt('123456'),
|
||||
|
||||
],
|
||||
|
||||
[
|
||||
|
||||
'name'=>'User',
|
||||
|
||||
'email'=>'user@itsolutionstuff.com',
|
||||
|
||||
'is_admin'=>'0',
|
||||
|
||||
'password'=> bcrypt('123456'),
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
foreach ($user as $key => $value) {
|
||||
|
||||
User::create($value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user