public function postIndex(UploadRequest $request) { $orginal = $request->file('picture'); $picture = new Picture(); $picture->save(); $tempname = uniqid('sotm-') . '.' . $orginal->getClientOriginalExtension(); $orginal->move('/tmp', $tempname); $picture->init("/tmp/{$tempname}"); $picture->addLocation($request); unlink("/tmp/{$tempname}"); }