コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $branche = new Station();
     $branche->user_id = Auth::user()->id;
     $branche->airport_id = $request->airport;
     if ($branche->save()) {
         return response()->json(['success' => true, 'airport' => Airport::find($request->airport)]);
     }
 }