mailerlite / laravel-elasticsearch

An easy way to use the official Elastic Search client in your Laravel applications.
MIT License
909 stars 187 forks source link

Make the manager macroable #153

Open indykoning opened 9 months ago

indykoning commented 9 months ago

By implementing https://laravel.com/api/10.x/Illuminate/Support/Traits/Macroable.html to https://github.com/mailerlite/laravel-elasticsearch/blob/main/src/Manager.php this will allow additional functions to be added to the Elasticsearch manager.

Making it so if extra customisation, or features need to be added inside of a specific project that it is not necessary to wrap this wrapper.

I think additionally running hasMacro, and if it resolves to true. Running the trait's __call should be enough. https://github.com/laravel/framework/blob/20085feef61119b58fef540cba79595b4a85a89a/src/Illuminate/Macroable/Traits/Macroable.php#L109