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

Publish views for customization #49

Closed
IP-Developer opened this issue May 23, 2020 · 2 comments · Fixed by #50
Closed

Publish views for customization #49

IP-Developer opened this issue May 23, 2020 · 2 comments · Fixed by #50

Comments

@IP-Developer
Copy link
Contributor

IP-Developer commented May 23, 2020

Instead of publishing the assets into public/js folder using artisan command, I set up Laravel Mix to copy the assets from vendor folder to public/admin/vendor folder as needed by my assets structure.
This works nice with the file manager being used as a widget on a page, but it breaks when using it as file browser when integrated into CKEditor (because package's setup.php still points to public/js).
It is easily solved by manually copying vendor's view files to views/vendor/ckfinder and editing them there, because, as per documentation, when requiring a vendor view (in this case view('ckfinder::browser')), Laravel will search both vendor's views folder and the app's views folder (in this case views/vendor/ckfinder/browser.php). I think it would be way easier to specify in the service provider that this package has publishable views. It would go like this:

$this->publishes([
       __DIR__.'/config.php' => config_path('ckfinder.php'),
       __DIR__.'/../public' => public_path('js'),
       __DIR__.'/../views' => resource_path('views/vendor/ckfinder')
], 'ckfinder');

Also, because this package's views are not using Blade, it is not possible to customize setup.php without also customizing the browser.php file. It would be better to use blade (rename browser.php and setup.php to browser.blade.php and setup.blade.php), and replace <?php include __DIR__.'/setup.php' ?> with @include('ckfinder::setup').

Going deeper, it would be better to set different publishing tags for assets and views. In my case, I don't need the assets to be published. I just need the config and the views. It also can be easily done.

If this gets approved, I can make a pull request that will integrate everything described in this issue.

@IP-Developer IP-Developer changed the title Publish views for customization [feature request] Publish views for customization May 23, 2020
@zaak
Copy link
Member

zaak commented May 25, 2020

Hi @IP-Developer. Thank you for the feedback, your proposal makes lots of sense. Feel free to send a PR!

@IP-Developer
Copy link
Contributor Author

Created pull-request #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants