Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code improvements #1063

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
15 changes: 12 additions & 3 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<YOUR LANGUAGE>/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/<LANGUAGE>`.
1. Edit translations as you please.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 9 additions & 5 deletions src/LaravelFilemanagerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,24 @@ 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([
__DIR__.'/../public' => public_path('vendor/laravel-filemanager'),
], '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([
Expand All @@ -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();
});
}
}
Expand All @@ -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;
Expand Down