Example #1
0
 public function put_update($id = null)
 {
     // Update the Account
     $response = API::put(array('account', $id), Input::all());
     // Handle response codes other than 200 OK
     if (!$response->success) {
         // Errors were found on our data! Redirect to form with errors and old input
         if ($response->code == 400) {
             return Redirect::to(prefix('admin') . 'account/' . $id . '/edit')->with('errors', new Messages($response->get()))->with_input('except', array('password'));
         }
         return Event::first($response->code);
     }
     // Add success notification
     Notification::success('Successfully updated account');
     return Redirect::to(prefix('admin') . 'accounts');
 }
Example #2
0
 public function put_update($slug = null)
 {
     // Update the Page
     $response = API::put(array('page', $slug), Input::all());
     // Handle response codes other than 200 OK
     if (!$response->success) {
         // Errors were found on our data! Redirect to form with errors and old input
         if ($response->code == 400) {
             return Redirect::to(prefix('admin') . 'page/edit/' . $slug)->with('errors', new Messages($response->get()))->with_input();
         }
         return Event::first($response->code);
     }
     // Add success notification
     Notification::success('Successfully updated page');
     return Redirect::to(prefix('admin') . 'pages');
 }