diff --git a/app/Http/Controllers/Users/AgencyController.php b/app/Http/Controllers/Users/AgencyController.php index bacdbc3..12018f0 100644 --- a/app/Http/Controllers/Users/AgencyController.php +++ b/app/Http/Controllers/Users/AgencyController.php @@ -77,10 +77,10 @@ class AgencyController extends Controller 'logo.file_extension' => __('validation.agency.logo.file_extension'), ]); - \File::delete(public_path('assets/imgs/'.Option::get('agency_logo_path'))); + \File::delete(storage_path('app/public/assets/imgs/'.Option::get('agency_logo_path'))); $filename = $file['logo']->getClientOriginalName(); - $file['logo']->move(public_path('assets/imgs'), $filename); + $file['logo']->move(storage_path('app/public/assets/imgs'), $filename); Option::set('agency_logo_path', $filename); flash(__('agency.updated'), 'success'); diff --git a/app/helpers.php b/app/helpers.php index cfe933f..81f9fb1 100755 --- a/app/helpers.php +++ b/app/helpers.php @@ -230,8 +230,8 @@ function app_logo_path() $defaultLogoImagePath = 'default-logo.png'; $optionLogoImagePath = Option::get('agency_logo_path'); - if (is_file(public_path('assets/imgs/'.$optionLogoImagePath))) { - return asset('assets/imgs/'.$optionLogoImagePath); + if (is_file(storage_path('app/public/assets/imgs/'.$optionLogoImagePath))) { + return asset('storage/assets/imgs/'.$optionLogoImagePath); } return asset('assets/imgs/'.$defaultLogoImagePath); diff --git a/storage/app/.gitignore b/storage/app/.gitignore index 566dd4b..5ca12cc 100755 --- a/storage/app/.gitignore +++ b/storage/app/.gitignore @@ -1,4 +1,4 @@ -* +# * !public/ !.gitignore !sample-image.png \ No newline at end of file diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore index d6b7ef3..a665600 100755 --- a/storage/app/public/.gitignore +++ b/storage/app/public/.gitignore @@ -1,2 +1,4 @@ -* +# * +assets/imgs/* +!assets/imgs/icon_user_1.png !.gitignore diff --git a/storage/app/public/assets/imgs/icon_user_1.png b/storage/app/public/assets/imgs/icon_user_1.png new file mode 100644 index 0000000..9c32168 Binary files /dev/null and b/storage/app/public/assets/imgs/icon_user_1.png differ diff --git a/tests/Feature/AgencyProfileTest.php b/tests/Feature/AgencyProfileTest.php index ac7cd88..5c11e8b 100644 --- a/tests/Feature/AgencyProfileTest.php +++ b/tests/Feature/AgencyProfileTest.php @@ -93,6 +93,6 @@ class AgencyProfileTest extends TestCase 'value' => 'sample-image.png', ]); - $this->assertFileExistsThenDelete(public_path('assets/imgs/sample-image.png')); + $this->assertFileExistsThenDelete(storage_path('app/public/assets/imgs/sample-image.png')); } } diff --git a/tests/Unit/Helpers/AppLogoImageTest.php b/tests/Unit/Helpers/AppLogoImageTest.php index 23b02fa..ed663d3 100644 --- a/tests/Unit/Helpers/AppLogoImageTest.php +++ b/tests/Unit/Helpers/AppLogoImageTest.php @@ -17,7 +17,7 @@ class AppLogoImageTest extends TestCase 'value' => 'icon_user_1.png', ]); - $this->assertEquals(asset('assets/imgs/icon_user_1.png'), app_logo_path()); + $this->assertEquals(asset('storage/assets/imgs/icon_user_1.png'), app_logo_path()); } /** @test */ @@ -45,7 +45,7 @@ class AppLogoImageTest extends TestCase ]); $logoString = 'assertEquals($logoString, app_logo_image());