public function daftar_berita() { $daftar = Berita::all(); return view('berita.daftar_berita', compact('daftar')); //$daftar_berita=Berita::all(); //dd($daftar_berita); }
public function index() { $data['menuse'] = Menu::orderBy('id')->get()->keyBy('id'); $data['lowongans'] = Lowongan::orderBy('id', 'desc')->take(3)->get(); $data['pengumumans'] = Pengumuman::orderBy('id', 'desc')->take(3)->get(); $data['agendas'] = Agenda::orderBy('id', 'desc')->take(3)->get(); $data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get(); $data['beritas'] = Berita::orderBy('id', 'desc')->take(6)->get(); $data['footers'] = Footer::orderBy('id')->get()->keyBy('id'); return view('index')->with('data', $data); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $beritas = Berita::find($id); $beritas->delete(); return response()->json(["pesan" => "dell"]); }
public function visi() { $data['menuse'] = Menu::orderBy('id')->get()->keyBy('id'); $data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get(); $data['footers'] = Footer::orderBy('id')->get()->keyBy('id'); $data['berita-footer'] = Berita::orderBy('id', 'desc')->take(9)->get(); $data['tentang-unit'] = AdminTentang::orderBy('id')->get()->keyBy('id'); return view('visi')->with('data', $data); }
public function hapus_userberita($id) { $user = Berita::whereName($id)->firstOrFail(); $user->delete(); return redirect()->route('berita'); }