activate() public method

Activate a user
Author: Steve Montambeault
public activate ( $id ) : boolean
$id
return boolean
示例#1
0
 /**
  * Activate a user
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function putActivate($id)
 {
     try {
         if ($this->users->activate($id)) {
             // User activation passed
             return Redirect::route('cpanel.users.index')->with('success', Lang::get('cpanel::users.activation_success'));
         } else {
             // User activation failed
             return Redirect::route('cpanel.users.index')->with('error', Lang::get('cpanel::users.activation_fail'));
         }
     } catch (UserNotFoundException $e) {
         return Redirect::route('cpanel.users.index')->with('error', $e->getMessage());
     }
 }