1public function uploadTest(Request $request) {
2
3 if(!$request->hasFile('image')) {
4 return response()->json(['upload_file_not_found'], 400);
5 }
6 $file = $request->file('image');
7 if(!$file->isValid()) {
8 return response()->json(['invalid_file_upload'], 400);
9 }
10 $path = public_path() . '/uploads/images/store/';
11 $file->move($path, $file->getClientOriginalName());
12 return response()->json(compact('path'));
13 }