awcodes / filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.
MIT License
188 stars 42 forks source link

Add view loader for view override #73

Closed shuguroff closed 8 months ago

shuguroff commented 8 months ago

Sometimes I need to override default view and make some changes

awcodes commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

php artisan vendor:publish

Screenshot 2023-11-14 at 1 48 12 PM

shuguroff commented 8 months ago

Thank you. It's my mistake.