Example #1
0
<?php

/*
|--------------------------------------------------------------------------
| 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 Closure to execute when that URI is requested.
|
*/
//login
Route::get('test', function () {
    $kelurahan = Kelurahan::all();
    $kepalaKeluarga = KepalaKeluarga::where('nama_kk', '=', 'Helmi')->first();
    return $kepalaKeluarga->kelurahan->nama_kelurahan;
});
Route::group(array('before' => 'auth'), function () {
    Route::get('logout', array('uses' => 'UserController@logout'));
    // Route yang ingin diproteksi simpan disini
    Route::get('/', function () {
        date_default_timezone_set("Asia/Bangkok");
        $tgl_reg = date("Y-m-d");
        $transdat = DB::table('v_datapasien')->where('tgl_reg', '=', $tgl_reg)->count();
        $transbil = Billing::where('tgl_reg', '=', $tgl_reg)->count();
        $transruj = ViewRujukandetail::where('tgl_reg', '=', $tgl_reg)->count();
        return View::make('index', compact('transbil', 'transruj', 'transdat'));
    });
    //dashboard
    Route::get('dashboard', 'DashboardController@index');