Esempio n. 1
0
 public function getViewmore($id)
 {
     if (!Auth::user() || Auth::user()->role == 100) {
         Redirect::to('/')->send();
     }
     $decleration = Decleration::findOrNew($id);
     $editables = $decleration->editables->lists('field_name')->toArray();
     return view('admin.view_more', ['decleration' => $decleration, 'editables' => $editables]);
 }
Esempio n. 2
0
 public function delete($id)
 {
     if (!Auth::user()) {
         return redirect('/');
     }
     $decleration = Decleration::findOrNew($id);
     if ($decleration->user_id != Auth::user()->id) {
         return redirect('/');
     }
     $decleration->delete($id);
     return redirect('/user_area');
 }