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

Add view loader for view override #73

Closed
wants to merge 1 commit into from
Closed

Add view loader for view override #73

wants to merge 1 commit into from

Conversation

shuguroff
Copy link

Sometimes I need to override default view and make some changes

@awcodes
Copy link
Owner

awcodes commented Nov 14, 2023

Sorry, I don't understand this PR.

The ->hasViews() and ->hasTranslations() modifier's add the ability to publish them with the normal Laravel artisan commands.

It's highly recommend not to override the views though, so do so at your own risk.

@shuguroff
Copy link
Author

There are no publishable resources when using

php artisan vendor:publish --provider="awcodes\filament-table-repeater" --tag=views

For example, I want to move add action button to the top right corner of table. To do this I need to publish view file, then change position.

According to Laravel Docs https://laravel.com/docs/10.x/packages#views

When you use the loadViewsFrom method, Laravel actually registers two locations for your views: the application's resources/views/vendor directory and the directory you specify. So, using the courier package as an example, Laravel will first check if a custom version of the view has been placed in the resources/views/vendor/courier directory by the developer. Then, if the view has not been customized, Laravel will search the package view directory you specified in your call to loadViewsFrom. This makes it easy for package users to customize / override your package's views.

@awcodes
Copy link
Owner

awcodes commented Nov 14, 2023

php artisan vendor:publish

Screenshot 2023-11-14 at 1 48 12 PM

@shuguroff
Copy link
Author

Thank you. It's my mistake.

@shuguroff shuguroff closed this Nov 14, 2023
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 this pull request may close these issues.

2 participants