Пример #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateFileRequest $request)
 {
     $title = $request->get('title');
     $description = $request->get('description');
     $path = $this->storeFile($request);
     $instance = File::create(['title' => $title, 'description' => $description, 'path' => $path]);
     return response()->json(['data' => "The file {$instance->name} was created with id {$instance->id}"], 200);
 }