Skip to content

Commit 89692b2

Browse files
committed
debugger added
permission issue in file upload fixed
1 parent e13b528 commit 89692b2

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

app/Http/Controllers/UserController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ function SaveProfile(Request $request){
318318
$file = $request->file('photo');
319319

320320
if(!empty($file)){
321+
if(!is_writable(public_path('/images'))){
322+
return json_encode(["error" => public_path('/images')." don't exist or don't have permission."]);
323+
}
321324
$image_path = $file->getClientOriginalName();
322325
$path = '/images/' . $image_path;
323326
$file->move(public_path('/images'), $image_path);

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"laravel/tinker": "^2.7"
1414
},
1515
"require-dev": {
16+
"barryvdh/laravel-debugbar": "^3.8",
1617
"fakerphp/faker": "^1.9.1",
1718
"laravel/pint": "^1.0",
1819
"laravel/sail": "^1.0.1",

storage/debugbar/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)