banner
This commit is contained in:
@@ -69,9 +69,15 @@ class FileController extends Controller
|
||||
$data['src'] = 'storage/'.$path.'/'.$file_name;
|
||||
$data['user_id'] = auth()->id();
|
||||
$data['sts'] = 1;
|
||||
$relativePath = $data['src'];
|
||||
$file_create = File::create($data);
|
||||
$file_create->setAttribute('full_src', File::publicUrl($data['src']));
|
||||
$fullSrc = File::publicUrl($relativePath);
|
||||
|
||||
return response()->json($file_create->fresh());
|
||||
$payload = $file_create->fresh()->toArray();
|
||||
$payload['path'] = $relativePath;
|
||||
$payload['full_src'] = $fullSrc;
|
||||
$payload['src'] = $fullSrc;
|
||||
|
||||
return response()->json($payload);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user