/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $example = Example::findOrFail($id); $example->delete(); \Flash::success('Voorbeeld verwijderd'); return redirect('admin/examples'); }
public function oshu() { $page = Page::where('slug', 'oshu')->first(); if ($page == null) { $new = new Page(); $new->slug = 'oshu'; $new->nav_title = 'OSHU - Wat doen we?'; $new->title = 'test'; $new->body = 'test'; $new->save(); } $page = Page::where('slug', 'oshu')->first(); $examples = Example::all(); return view('pages.public.oshu', compact('page', 'examples')); }
public function postDelete($id) { $job = Example::find($id); $job->delete(); return response($job->id); }