This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
ModuleWeb/SRC/database/seeds/DatabaseSeeder.php

70 lines
1.4 KiB
PHP
Raw Normal View History

2015-02-12 12:56:47 +00: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 06:12:44 +00:00
$this->call('UserTableSeeder');
2015-02-12 12:56:47 +00:00
}
}
2015-02-15 06:12:44 +00:00
class UserTableSeeder extends Seeder {
public function run()
{
// Uncomment the below to wipe the table clean before populating
//DB::table('users')->truncate();
$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 06:12:44 +00:00
$user = array(
2015-02-17 19:46:50 +00:00
'firstname' => 'admin',
'lastname' => 'admin',
'city' => 'Montauban',
'email' => 'admin@admin.com',
2015-02-15 06:12:44 +00:00
'password' => Hash::make('admin'),
2015-02-17 20:57:41 +00:00
'image' => 'pictures/user_picture/default.png',
'droits' => '1'
);
// Uncomment the below to run the seeder
DB::table('users')->insert($user);
$user = array(
2015-02-17 19:46:50 +00:00
'lastname' => 'ref',
'firstname' => 'ref',
'city' => 'Toulouse',
'email' => 'ref@ref.com',
'password' => Hash::make('ref'),
2015-02-17 20:57:41 +00:00
'image' => 'pictures/user_picture/default.png',
'droits' => '0'
2015-02-15 06:12:44 +00:00
);
// Uncomment the below to run the seeder
DB::table('users')->insert($user);
}
}