Exemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $lists = shop_reservation_jonathans::all();
     return view('list', ['lists' => $lists]);
 }
Exemplo n.º 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     //送られてきた情報を受け取る
     $reservation_time = $request->input('reservation_time');
     //shop_reservation_jonathansモデルを指定。そのなかのshop_nameがjonathansの物の
     shop_reservation_jonathans::where('shop_name', 'jonathans')->insert(['reservation_time' => $reservation_time]);
     //ちなみにテーブルの指定はモデルで設定しているよ
     //$reservation_time->save();
     //$reservation_time = $request->input('reservation_time');
     // Cache::put('reservation_time', $reservation_time, 30);
     // $reservation_time = Cache::get('reservation_time');
     // $now = DB::select('select current_timestamp');//DBの現在時刻を取りに行く
     // DB::table('shop_reservation_jonathans')->insert(['reservation_time' => $reservation_time ,'shop_name' => 'jonathans']);
     return 'insert Successfully done!';
 }