コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $photo = Request::file('image');
     $notes = Request::input('notes');
     $image = new App\Image();
     $image->make($photo, $notes);
     $image->name = $image->getName();
     $image->latitude = $image->getLatitude();
     $image->longitude = $image->getLongitude();
     $image->date = $image->getDate();
     $image->time = $image->getTime();
     $image->notes = $notes;
     $image->created_at = Carbon::now();
     $image->updated_at = Carbon::now();
     $image->save();
     return redirect()->action('AlleyController@create');
 }