public function daftar_bagian() { $no = "1"; $daftar_bagian = Bagian::orderBy('bagian', 'asc')->get(); return view('admin.daftar_bagian', compact('daftar_bagian', 'no')); }
<?php use App\Bagian; /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ if (Schema::hasTable('Bagian')) { View::share('sbagian', Bagian::orderBy('bagian', 'asc')->get()); } Route::get('/', ['as' => 'home', 'middleware' => 'auth', function () { return view('home.admin'); }]); Route::get('/admin', function () { return view('home.admin'); }); Route::get('/keuangan', function () { return view('home.keuangan'); }); Route::get('/dekan', function () { return view('home.dekan'); }); Route::get('/bpp', function () { return view('home.bpp'); });
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Bagian $bagian) { $bagian->delete(); return redirect('/bagian'); }