cybercog / laravel-love

Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
https://komarev.com/sources/laravel-love
MIT License
1.17k stars 71 forks source link

How to stop queue-ing new jobs #209

Closed m7vm7v closed 2 years ago

m7vm7v commented 2 years ago

First of all great package, many thanks for the support!

Is there a way not to use the laravel's queueable jobs but calculate the count on a go?

Or if we do not use the count feature, can we stop filling the jobs table?

antonkomarev commented 2 years ago

Yes, you can disable counters aggregating, but this way is not suggested because you have to implement all on-the-fly logic by yourself and it will be pretty complex and slightly increase load.

You can use opt-out package discovery in composer.json of your app.

"extra": {
    "laravel": {
        "dont-discover": [
            "cybercog/laravel-love"
        ]
    }
},

This will disable auto-discovery of 2 service providers:

Then you have to re-register Cog\Laravel\Love\LoveServiceProvider manually in config/app.php file, because it contains core functionality.