<?php

/*
|--------------------------------------------------------------------------
| Application & Route Filters
|--------------------------------------------------------------------------
|
| Below you will find the "before" and "after" events for the application
| which may be used to do any work before or after a request into your
| application. Here you may also register your custom route filters.
|
*/
App::before(function ($request) {
    $default = ['' => ''];
    $users = $default + MstUser::select('id', DB::raw('CONCAT(id, ".", name1) AS name1'))->whereDel(0)->lists('name1', 'id');
    $halls = $default + MstHall::select('id', DB::raw('CONCAT(id, ".", name1) AS name1'))->whereDel(0)->lists('name1', 'id');
    $machines = $default + MstMachine::select('id', DB::raw('CONCAT(id, ".", name1) AS name1'))->whereDel(0)->lists('name1', 'id');
    $legals = $default + MstLegal::select('id', DB::raw('CONCAT(id, ".", name1) AS name1'))->whereDel(0)->lists('name1', 'id');
    $sources = $default + MstOrdersource::select('id', DB::raw('CONCAT(id, ".", name1) AS name1'))->whereDel(0)->lists('name1', 'id');
    $contacts = $default + MstOrdercontact::select('id', DB::raw('CONCAT(id, ".", name1) AS name1'))->whereDel(0)->lists('name1', 'id');
    View::share(compact('users', 'halls', 'machines', 'legals', 'sources', 'contacts'));
});
App::after(function ($request, $response) {
    //
});
/*
|--------------------------------------------------------------------------
| Authentication Filters
|--------------------------------------------------------------------------
|
| The following filters are used to verify that the user of the current
 public function getLogin()
 {
     $default = ['' => '選択してください'];
     $users = $default + MstUser::select('id', DB::raw('CONCAT(id, ".", name1) AS name1'))->lists('name1', 'id');
     return View::make('auth.login', compact('users'));
 }