From 2e66551fc5f4b84fb9a3952b176394ad265bd243 Mon Sep 17 00:00:00 2001 From: Yuriy Martini Date: Wed, 31 Mar 2021 12:01:11 +0200 Subject: [PATCH 1/4] move lang & views to resources path --- Makefile | 2 +- {src => resources}/lang/ar/lfm.php | 0 {src => resources}/lang/az/lfm.php | 0 {src => resources}/lang/bg/lfm.php | 0 {src => resources}/lang/de/lfm.php | 0 {src => resources}/lang/el/lfm.php | 0 {src => resources}/lang/en/lfm.php | 0 {src => resources}/lang/es/lfm.php | 0 {src => resources}/lang/eu/lfm.php | 0 {src => resources}/lang/fa/lfm.php | 0 {src => resources}/lang/fr/lfm.php | 0 {src => resources}/lang/he/lfm.php | 0 {src => resources}/lang/hu/lfm.php | 0 {src => resources}/lang/id/lfm.php | 0 {src => resources}/lang/it/lfm.php | 0 {src => resources}/lang/ka/lfm.php | 0 {src => resources}/lang/nl/lfm.php | 0 {src => resources}/lang/pl/lfm.php | 0 {src => resources}/lang/pt-BR/lfm.php | 0 {src => resources}/lang/pt/lfm.php | 0 {src => resources}/lang/ro/lfm.php | 0 {src => resources}/lang/rs/lfm.php | 0 {src => resources}/lang/ru/lfm.php | 0 {src => resources}/lang/sv/lfm.php | 0 {src => resources}/lang/tr/lfm.php | 0 {src => resources}/lang/uk/lfm.php | 0 {src => resources}/lang/vi/lfm.php | 0 {src => resources}/lang/zh-CN/lfm.php | 0 {src => resources}/lang/zh-TW/lfm.php | 0 {src => resources}/views/crop.blade.php | 0 {src => resources}/views/demo.blade.php | 0 {src => resources}/views/index.blade.php | 0 {src => resources}/views/move.blade.php | 0 {src => resources}/views/resize.blade.php | 0 {src => resources}/views/tree.blade.php | 0 {src => resources}/views/use.blade.php | 0 src/LaravelFilemanagerServiceProvider.php | 4 ++-- 37 files changed, 3 insertions(+), 3 deletions(-) rename {src => resources}/lang/ar/lfm.php (100%) rename {src => resources}/lang/az/lfm.php (100%) rename {src => resources}/lang/bg/lfm.php (100%) rename {src => resources}/lang/de/lfm.php (100%) rename {src => resources}/lang/el/lfm.php (100%) rename {src => resources}/lang/en/lfm.php (100%) rename {src => resources}/lang/es/lfm.php (100%) rename {src => resources}/lang/eu/lfm.php (100%) rename {src => resources}/lang/fa/lfm.php (100%) rename {src => resources}/lang/fr/lfm.php (100%) rename {src => resources}/lang/he/lfm.php (100%) rename {src => resources}/lang/hu/lfm.php (100%) rename {src => resources}/lang/id/lfm.php (100%) rename {src => resources}/lang/it/lfm.php (100%) rename {src => resources}/lang/ka/lfm.php (100%) rename {src => resources}/lang/nl/lfm.php (100%) rename {src => resources}/lang/pl/lfm.php (100%) rename {src => resources}/lang/pt-BR/lfm.php (100%) rename {src => resources}/lang/pt/lfm.php (100%) rename {src => resources}/lang/ro/lfm.php (100%) rename {src => resources}/lang/rs/lfm.php (100%) rename {src => resources}/lang/ru/lfm.php (100%) rename {src => resources}/lang/sv/lfm.php (100%) rename {src => resources}/lang/tr/lfm.php (100%) rename {src => resources}/lang/uk/lfm.php (100%) rename {src => resources}/lang/vi/lfm.php (100%) rename {src => resources}/lang/zh-CN/lfm.php (100%) rename {src => resources}/lang/zh-TW/lfm.php (100%) rename {src => resources}/views/crop.blade.php (100%) rename {src => resources}/views/demo.blade.php (100%) rename {src => resources}/views/index.blade.php (100%) rename {src => resources}/views/move.blade.php (100%) rename {src => resources}/views/resize.blade.php (100%) rename {src => resources}/views/tree.blade.php (100%) rename {src => resources}/views/use.blade.php (100%) diff --git a/Makefile b/Makefile index 40c3a04c..41101341 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ test: vendor/bin/phpunit --coverage-text - vendor/bin/phpcs --version && echo && vendor/bin/phpcs -p --standard=PSR2 --ignore=src/lang/,src/views/ src tests + vendor/bin/phpcs --version && echo && vendor/bin/phpcs -p --standard=PSR2 --ignore=resources/lang/,resources/views/ src tests diff --git a/src/lang/ar/lfm.php b/resources/lang/ar/lfm.php similarity index 100% rename from src/lang/ar/lfm.php rename to resources/lang/ar/lfm.php diff --git a/src/lang/az/lfm.php b/resources/lang/az/lfm.php similarity index 100% rename from src/lang/az/lfm.php rename to resources/lang/az/lfm.php diff --git a/src/lang/bg/lfm.php b/resources/lang/bg/lfm.php similarity index 100% rename from src/lang/bg/lfm.php rename to resources/lang/bg/lfm.php diff --git a/src/lang/de/lfm.php b/resources/lang/de/lfm.php similarity index 100% rename from src/lang/de/lfm.php rename to resources/lang/de/lfm.php diff --git a/src/lang/el/lfm.php b/resources/lang/el/lfm.php similarity index 100% rename from src/lang/el/lfm.php rename to resources/lang/el/lfm.php diff --git a/src/lang/en/lfm.php b/resources/lang/en/lfm.php similarity index 100% rename from src/lang/en/lfm.php rename to resources/lang/en/lfm.php diff --git a/src/lang/es/lfm.php b/resources/lang/es/lfm.php similarity index 100% rename from src/lang/es/lfm.php rename to resources/lang/es/lfm.php diff --git a/src/lang/eu/lfm.php b/resources/lang/eu/lfm.php similarity index 100% rename from src/lang/eu/lfm.php rename to resources/lang/eu/lfm.php diff --git a/src/lang/fa/lfm.php b/resources/lang/fa/lfm.php similarity index 100% rename from src/lang/fa/lfm.php rename to resources/lang/fa/lfm.php diff --git a/src/lang/fr/lfm.php b/resources/lang/fr/lfm.php similarity index 100% rename from src/lang/fr/lfm.php rename to resources/lang/fr/lfm.php diff --git a/src/lang/he/lfm.php b/resources/lang/he/lfm.php similarity index 100% rename from src/lang/he/lfm.php rename to resources/lang/he/lfm.php diff --git a/src/lang/hu/lfm.php b/resources/lang/hu/lfm.php similarity index 100% rename from src/lang/hu/lfm.php rename to resources/lang/hu/lfm.php diff --git a/src/lang/id/lfm.php b/resources/lang/id/lfm.php similarity index 100% rename from src/lang/id/lfm.php rename to resources/lang/id/lfm.php diff --git a/src/lang/it/lfm.php b/resources/lang/it/lfm.php similarity index 100% rename from src/lang/it/lfm.php rename to resources/lang/it/lfm.php diff --git a/src/lang/ka/lfm.php b/resources/lang/ka/lfm.php similarity index 100% rename from src/lang/ka/lfm.php rename to resources/lang/ka/lfm.php diff --git a/src/lang/nl/lfm.php b/resources/lang/nl/lfm.php similarity index 100% rename from src/lang/nl/lfm.php rename to resources/lang/nl/lfm.php diff --git a/src/lang/pl/lfm.php b/resources/lang/pl/lfm.php similarity index 100% rename from src/lang/pl/lfm.php rename to resources/lang/pl/lfm.php diff --git a/src/lang/pt-BR/lfm.php b/resources/lang/pt-BR/lfm.php similarity index 100% rename from src/lang/pt-BR/lfm.php rename to resources/lang/pt-BR/lfm.php diff --git a/src/lang/pt/lfm.php b/resources/lang/pt/lfm.php similarity index 100% rename from src/lang/pt/lfm.php rename to resources/lang/pt/lfm.php diff --git a/src/lang/ro/lfm.php b/resources/lang/ro/lfm.php similarity index 100% rename from src/lang/ro/lfm.php rename to resources/lang/ro/lfm.php diff --git a/src/lang/rs/lfm.php b/resources/lang/rs/lfm.php similarity index 100% rename from src/lang/rs/lfm.php rename to resources/lang/rs/lfm.php diff --git a/src/lang/ru/lfm.php b/resources/lang/ru/lfm.php similarity index 100% rename from src/lang/ru/lfm.php rename to resources/lang/ru/lfm.php diff --git a/src/lang/sv/lfm.php b/resources/lang/sv/lfm.php similarity index 100% rename from src/lang/sv/lfm.php rename to resources/lang/sv/lfm.php diff --git a/src/lang/tr/lfm.php b/resources/lang/tr/lfm.php similarity index 100% rename from src/lang/tr/lfm.php rename to resources/lang/tr/lfm.php diff --git a/src/lang/uk/lfm.php b/resources/lang/uk/lfm.php similarity index 100% rename from src/lang/uk/lfm.php rename to resources/lang/uk/lfm.php diff --git a/src/lang/vi/lfm.php b/resources/lang/vi/lfm.php similarity index 100% rename from src/lang/vi/lfm.php rename to resources/lang/vi/lfm.php diff --git a/src/lang/zh-CN/lfm.php b/resources/lang/zh-CN/lfm.php similarity index 100% rename from src/lang/zh-CN/lfm.php rename to resources/lang/zh-CN/lfm.php diff --git a/src/lang/zh-TW/lfm.php b/resources/lang/zh-TW/lfm.php similarity index 100% rename from src/lang/zh-TW/lfm.php rename to resources/lang/zh-TW/lfm.php diff --git a/src/views/crop.blade.php b/resources/views/crop.blade.php similarity index 100% rename from src/views/crop.blade.php rename to resources/views/crop.blade.php diff --git a/src/views/demo.blade.php b/resources/views/demo.blade.php similarity index 100% rename from src/views/demo.blade.php rename to resources/views/demo.blade.php diff --git a/src/views/index.blade.php b/resources/views/index.blade.php similarity index 100% rename from src/views/index.blade.php rename to resources/views/index.blade.php diff --git a/src/views/move.blade.php b/resources/views/move.blade.php similarity index 100% rename from src/views/move.blade.php rename to resources/views/move.blade.php diff --git a/src/views/resize.blade.php b/resources/views/resize.blade.php similarity index 100% rename from src/views/resize.blade.php rename to resources/views/resize.blade.php diff --git a/src/views/tree.blade.php b/resources/views/tree.blade.php similarity index 100% rename from src/views/tree.blade.php rename to resources/views/tree.blade.php diff --git a/src/views/use.blade.php b/resources/views/use.blade.php similarity index 100% rename from src/views/use.blade.php rename to resources/views/use.blade.php diff --git a/src/LaravelFilemanagerServiceProvider.php b/src/LaravelFilemanagerServiceProvider.php index b57de295..de5c8e6b 100644 --- a/src/LaravelFilemanagerServiceProvider.php +++ b/src/LaravelFilemanagerServiceProvider.php @@ -17,7 +17,7 @@ class LaravelFilemanagerServiceProvider extends ServiceProvider */ public function boot() { - $this->loadTranslationsFrom(__DIR__.'/lang', 'laravel-filemanager'); + $this->loadTranslationsFrom(__DIR__.'/../lang', 'laravel-filemanager'); $this->loadViewsFrom(__DIR__.'/views', 'laravel-filemanager'); @@ -30,7 +30,7 @@ public function boot() ], 'lfm_public'); $this->publishes([ - __DIR__.'/views' => base_path('resources/views/vendor/laravel-filemanager'), + __DIR__.'/../resources/views' => base_path('resources/views/vendor/laravel-filemanager'), ], 'lfm_view'); $this->publishes([ From 53535ebbfbcb88c46256f32b026b58cebd93bd6e Mon Sep 17 00:00:00 2001 From: Yuriy Martini Date: Wed, 31 Mar 2021 12:02:26 +0200 Subject: [PATCH 2/4] move config to root path --- {src/config => config}/lfm.php | 0 src/LaravelFilemanagerServiceProvider.php | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename {src/config => config}/lfm.php (100%) diff --git a/src/config/lfm.php b/config/lfm.php similarity index 100% rename from src/config/lfm.php rename to config/lfm.php diff --git a/src/LaravelFilemanagerServiceProvider.php b/src/LaravelFilemanagerServiceProvider.php index de5c8e6b..b8d0cbf3 100644 --- a/src/LaravelFilemanagerServiceProvider.php +++ b/src/LaravelFilemanagerServiceProvider.php @@ -22,7 +22,7 @@ public function boot() $this->loadViewsFrom(__DIR__.'/views', 'laravel-filemanager'); $this->publishes([ - __DIR__ . '/config/lfm.php' => base_path('config/lfm.php'), + __DIR__.'/../config/lfm.php' => base_path('config/lfm.php'), ], 'lfm_config'); $this->publishes([ @@ -39,7 +39,7 @@ public function boot() if (config('lfm.use_package_routes')) { Route::group(['prefix' => 'filemanager', 'middleware' => ['web', 'auth']], function () { - \UniSharp\LaravelFilemanager\Lfm::routes(); + Lfm::routes(); }); } } @@ -51,7 +51,7 @@ public function boot() */ public function register() { - $this->mergeConfigFrom(__DIR__ . '/config/lfm.php', 'lfm-config'); + $this->mergeConfigFrom(__DIR__.'/../config/lfm.php', 'lfm-config'); $this->app->singleton('laravel-filemanager', function () { return true; From bcc7397555c0f3ceb684a47889cf1920f2bda042 Mon Sep 17 00:00:00 2001 From: Yuriy Martini Date: Wed, 31 Mar 2021 12:03:52 +0200 Subject: [PATCH 3/4] publish translations --- src/LaravelFilemanagerServiceProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/LaravelFilemanagerServiceProvider.php b/src/LaravelFilemanagerServiceProvider.php index b8d0cbf3..c5695519 100644 --- a/src/LaravelFilemanagerServiceProvider.php +++ b/src/LaravelFilemanagerServiceProvider.php @@ -21,6 +21,10 @@ public function boot() $this->loadViewsFrom(__DIR__.'/views', 'laravel-filemanager'); + $this->publishes([ + __DIR__.'/../resources/lang' => 'resources/lang/vendor/laravel-filemanager', + ], ['lfm', 'lang', 'lfm_lang']); + $this->publishes([ __DIR__.'/../config/lfm.php' => base_path('config/lfm.php'), ], 'lfm_config'); From b8df064a609967e37686d4ddb9118d5e86285dae Mon Sep 17 00:00:00 2001 From: Yuriy Martini Date: Wed, 31 Mar 2021 12:10:44 +0200 Subject: [PATCH 4/4] update docs --- docs/customization.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/customization.md b/docs/customization.md index b665f700..4d5d09bd 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -35,13 +35,22 @@ ``` ## Views -Copy views to `resources/views/vendor/unisharp/laravel-filemanager/` : + +Publish views: ```bash php artisan vendor:publish --tag=lfm_view ``` +Edit views in `/resources/views/vendor/laravel-filemanager`. + ## Translations -1. Copy `vendor/unisharp/laravel-filemanager/src/lang/en` to `/resources/lang/vendor/laravel-filemanager//lfm.php`. -1. Edit the file as you please. +Publish translations: + +```bash +php artisan vendor:publish --tag=lfm_lang +``` + +1. Copy `/resources/lang/vendor/laravel-filemanager/en` to `/resources/lang/vendor/laravel-filemanager/`. +1. Edit translations as you please.