/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $role = new Role();
     $role->description = "user";
     $role->save();
     $role = new Role();
     $role->description = "tech";
     $role->save();
     $role->users()->attach(User::defaultUser());
     $role = new Role();
     $role->description = "admin";
     $role->save();
 }
Esempio n. 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show(Role $role)
 {
     $users = $role->users()->get();
     return view('users.roles', compact('users'));
 }