public function edit_artikel_en($slug) { $artikel = Article::with('kategori')->whereSlug($slug)->firstOrFail(); $kategori = KategoriArtikel::where('id', '!=', $artikel->kategori->id)->get(); return view('artikel.edit_artikel_en', compact('kategori', 'artikel')); }
public function deletekategori($slug) { $kategori = KategoriArtikel::whereSlug_id($slug)->firstOrFail(); $kategori->delete(); return redirect()->route('admin-kategori')->with('message', 'Kategori telah dihapus...'); }
<?php use contoh\Profil; use contoh\About; use contoh\KategoriArtikel; #ViewShare if (Schema::hasTable('profil') and Schema::hasTable('about') and Schema::hasTable('kategori_artikel')) { View::share('daftarprofil', Profil::oldest()->get()); View::share('aboutlist', About::oldest()->get()); View::share('kategori_artikel', KategoriArtikel::oldest()->get()); } $bahasa = Request::segment(1); if (in_array($bahasa, Config::get('app.bahasa'))) { App::setLocale($bahasa); } else { $bahasa = 'id'; } #RouteGroup MultiLanguage Route::group(['prefix' => $bahasa], function () { Route::get('/', ['as' => 'home', 'uses' => 'HomepageController@index']); #Search Route::post('search', ['as' => 'search', 'uses' => 'HomepageController@search']); Route::get('search/{cari}', ['as' => 'searchresults', 'uses' => 'HomepageController@searchresults']); #AdminHome Route::get('home', ['as' => 'admin-homepage', 'uses' => 'AdminController@homepage']); #Profil #Showprofil - ID Route::get('profil/{slug}', ['as' => 'showprofil_id', 'uses' => 'ProfilController@showprofil_id']); #Showprofil - EN Route::get('about/{slug}', ['as' => 'showprofil_en', 'uses' => 'ProfilController@showprofil_en']); #Berita
public function kategori() { $daftar_kategori = KategoriArtikel::latest()->paginate(5)->setPath('kategori-artikel'); return view('admin.kategori', compact('daftar_kategori')); }