Beispiel #1
0
/*
|--------------------------------------------------------------------------
| 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.
|
*/
Route::get('/', function () {
    return View('sativa.index')->with(["artikel" => App\Artikel::where('aktif', '=', 'y')->orderBy('id', 'desc')->get(), "kategori" => App\Kategori::where('aktif', '=', 'y')->get()]);
});
Route::get('/read/{slug}', function ($slug) {
    $data = array("artikel_pilih" => App\Artikel::where('slug', '=', $slug)->get(), "artikel" => App\Artikel::all(), "kategori" => App\Kategori::where('aktif', '=', 'y')->get());
    return View('sativa.readmore')->with('data', $data);
});
/*Route::get('/tag/{kategori}', function($kategori){
	return View('sativa.read_kat')->with(['data' => App\Artikel::where('kategori','=',$kategori)->get(), 
										  'artikel' => App\Artikel::all(),
										  'kategori' => App\Kategori::where('aktif','=','y')->get()]);
});*/
Route::get('/bos', function () {
    return View('sativa.admin.index');
});
Route::get('/bos/artikel', function () {
    $data = array("artikel" => App\Artikel::all(), "kategori" => App\Kategori::all());
    return View('sativa.admin.tambah_artikel')->with('data', $data);
});
Route::get('/bos/kategori', function () {