Esempio n. 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('users')->delete();
     $users = array(array('name' => 'maik', 'email' => '*****@*****.**', 'password' => Hash::make('12345678'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()));
     DB::table('users')->insert($users);
     DB::table('abilities')->delete();
     $abilities = array(array('id' => '1', 'name' => 'admin_master', 'description' => 'The master of the universe', 'created_at' => new DateTime(), 'updated_at' => new DateTime()), array('id' => '2', 'name' => 'post_blog', 'description' => 'Post a blog', 'created_at' => new DateTime(), 'updated_at' => new DateTime()));
     DB::table('abilities')->insert($abilities);
     $maik = User::where('name', 'maik')->first();
     $ab = Ability::where('name', 'admin_master')->first();
     //$abs=[$ab];
     $maik->abilities()->attach($ab);
 }
Esempio n. 2
0
 public static function superUser()
 {
     //\Debugbar::info(Ability::where('name', 'admin_master')->first()->id);
     return Ability::where('name', Ability::$master)->first()->id;
 }