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]); }
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'); }