Exemplo n.º 1
0
    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 () {
    $data = App\Kategori::all();
    return View('sativa.admin.tambah_kategori')->with('data', $data);
});
Route::post('/bos/{jenis}', 'BlogController@store');
Route::get('/hapus/{jenis}/{id}', 'BlogController@destroy');
Route::get('/edit/{jenis}/{id}', 'BlogController@edit');
Route::post('/update/{jenis}/{id}', 'BlogController@update');
Route::get('/default', function () {
    return View('sativa.default');
});
/*Route::controller([
		'auth' => 'Auth\AuthController',
Exemplo n.º 2
0
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in 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::bind("bier", function($brouwernr)
{
	return App\Bier::whereBrouwernr($brouwernr)->first();
});
*/
Route::bind("artikels", function ($artikels) {
    return App\Artikel::find($artikels);
});
/*Route::get("/", "pagesController@index");
Route::get("about", "pagesController@about");
Route::get("artikels", "ArtikelsController@index");
Route::get("artikels/{id}", "ArtikelsController@show");
Route::get("artikels/{id}/edit", "ArtikelsController@edit");
Route::patch("artikels/{id}", "ArtikelsController@update");*/
$router->resource("artikels", "ArtikelsController", ["only" => ["index", "show", "edit", "update"]]);
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP