/** * Display a listing of the resource. * * @return Response */ public function index() { //load the home page of all models for resume entry $educations = Education::orderBy('graduationyear', 'desc')->get(); $skillcategories = SkillCategory::orderBy('title', 'asc')->get(); $jobs = Job::orderBy('currentlyemployed', 'desc')->orderBy('enddate', 'desc')->get(); $article = Article::findOrFail('1'); //get the summary article with id of 1 return view('admin.index', compact('educations', 'jobs', 'skillcategories', 'article')); }
/** * Show the form for creating a new resource. * * @return Response */ public function create($id) { $job = Job::findOrFail($id); return view('achievements.create', compact('job')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $job = Job::findOrFail($id); $job->delete(); $job->achievements()->delete(); return redirect('jobs')->with('success', 'Successfully deleted job!'); }