2015-02-12 13:56:47 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class DatabaseSeeder extends Seeder {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run the database seeds.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
Model::unguard();
|
|
|
|
|
2015-02-15 07:12:44 +01:00
|
|
|
$this->call('UserTableSeeder');
|
2015-02-12 13:56:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2015-02-15 07:12:44 +01:00
|
|
|
|
|
|
|
class UserTableSeeder extends Seeder {
|
|
|
|
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
// Uncomment the below to wipe the table clean before populating
|
|
|
|
//DB::table('users')->truncate();
|
2015-02-17 22:45:45 +01:00
|
|
|
|
|
|
|
$user = array(
|
|
|
|
'firstname' => 'superadmin',
|
|
|
|
'lastname' => 'superadmin',
|
|
|
|
'city' => 'Montauban',
|
|
|
|
'email' => 'superAdmin@superAdmin.com',
|
|
|
|
'password' => Hash::make('superadmin'),
|
|
|
|
'image' => 'pictures/user_picture/default.png',
|
|
|
|
'droits' => '2'
|
|
|
|
);
|
|
|
|
|
|
|
|
// Uncomment the below to run the seeder
|
|
|
|
DB::table('users')->insert($user);
|
2015-02-15 07:12:44 +01:00
|
|
|
|
|
|
|
$user = array(
|
2015-02-17 20:46:50 +01:00
|
|
|
'firstname' => 'admin',
|
|
|
|
'lastname' => 'admin',
|
|
|
|
'city' => 'Montauban',
|
2015-02-15 07:43:10 +01:00
|
|
|
'email' => 'admin@admin.com',
|
2015-02-15 07:12:44 +01:00
|
|
|
'password' => Hash::make('admin'),
|
2015-02-17 21:57:41 +01:00
|
|
|
'image' => 'pictures/user_picture/default.png',
|
2015-02-17 22:45:45 +01:00
|
|
|
'droits' => '1'
|
2015-02-15 07:43:10 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
// Uncomment the below to run the seeder
|
|
|
|
DB::table('users')->insert($user);
|
|
|
|
|
|
|
|
$user = array(
|
2015-02-17 20:46:50 +01:00
|
|
|
'lastname' => 'ref',
|
|
|
|
'firstname' => 'ref',
|
|
|
|
'city' => 'Toulouse',
|
2015-02-15 07:43:10 +01:00
|
|
|
'email' => 'ref@ref.com',
|
|
|
|
'password' => Hash::make('ref'),
|
2015-02-17 21:57:41 +01:00
|
|
|
'image' => 'pictures/user_picture/default.png',
|
2015-02-17 22:45:45 +01:00
|
|
|
'droits' => '0'
|
2015-02-15 07:12:44 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
// Uncomment the below to run the seeder
|
|
|
|
DB::table('users')->insert($user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|