Exemplo n.º 1
0
 public static function getName($cid)
 {
     $record = ConsoleUser::findOrFail($cid);
     $name = $record->name;
     return $name;
 }
Exemplo n.º 2
0
 public function post_profilesave()
 {
     //Get our inputs
     $name = Input::get('inputName');
     $email = Input::get('inputEmail');
     $ticketnotifications = Input::get('inputTicketNotifications');
     //Start the validator
     $validator = Validator::make(array('name' => $name, 'email' => $email, 'ticketnotifications' => $ticketnotifications), array('name' => 'required', 'email' => 'required|email', 'ticketnotifications' => 'required|in:0,1'));
     if ($validator->fails()) {
         return Redirect::route('consoleprofile')->withErrors($validator);
     }
     //Great validation passed. Now let's push these updates
     $auditor = ConsoleUser::findOrFail(Auth::consoleuser()->get()->cid);
     $auditor->name = $name;
     $auditor->email = $email;
     $auditor->ticketnotifications = $ticketnotifications;
     //Save
     $auditor->save();
     //Redirect back with message
     return Redirect::route('consoleprofile')->with('message', 'Profile Updated Successfully.');
 }