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/config/lfm.php b/config/lfm.php similarity index 100% rename from src/config/lfm.php rename to config/lfm.php 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. 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..c5695519 100644 --- a/src/LaravelFilemanagerServiceProvider.php +++ b/src/LaravelFilemanagerServiceProvider.php @@ -17,12 +17,16 @@ 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'); $this->publishes([ - __DIR__ . '/config/lfm.php' => base_path('config/lfm.php'), + __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'); $this->publishes([ @@ -30,7 +34,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([ @@ -39,7 +43,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 +55,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;