Пример #1
0
 /**
  * Implement create($input)
  */
 public function create($input)
 {
     $role = Role::create($input);
     // if you create it, you need access to it.
     $roleUser = RoleUser::create(['role_id' => $role['id'], 'user_id' => Auth::user()->id]);
     //dd(__METHOD__.'('.__LINE__.')',compact('input','role','roleUser'));
     return $role;
 }
Пример #2
0
 /**
  * Implement update($id, $input)
  */
 public function update($id, $input)
 {
     $role = RoleUser::find($id);
     //dd(__METHOD__.'('.__LINE__.')'.': ',compact('id','input','role'));
     return $role->update($input);
 }