sage-directives
sage-directives copied to clipboard
Add filters to easy overwrite or change used directives.
Returned collection of directive can be filterable so we can easily overwrite or change directives registered to blade by this package. Now all directives all registered and we can not stop it or something.
I plan on refactoring this package in the future (as time permits) – I will make that a possibility.
Okay, thats sounds great - I can help you if you want :)
I'd mainly like to do the tedious task of separating every directive into their own class and then having a service provider that has then all in an array as [Directive::class]
(which will then be filterable) and calls them all.
Some of the directives need refactored as well due to the annoying amount of logic needed.
Of course - every directive must be class with implemented __invoke
magic method. We can also publish config for directives in user application - that will be good enough and can be replace with apply_filters
for entire array.
Only case where filter will be needed is before call to register it in blade eg. apply_filters('sage/blade/register_directive', true, Directive::class)