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?

Home Page:https://komarev.com/sources/laravel-love

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

non-nullable Reactants

volkv opened this issue · comments

Hi. Docs saying

Remove --nullable flag if all models of this type must be reacterable:

$ php artisan love:setup-reacterable --model="App\User"

How should it work if you observe Created event which is fired after model is inserted into DB (which is not possible with non-nullable field)..?

Hi @volkv! Initially I've thought that it might be useful when you are implementing your own logic. But it will require to implement your own models and observers. To be honest I've never used non-nullable fields.

I think it will be better to add --not-nullable flag in future versions and make this command to generate nullable fields by default.

I just checked, it does not work if --nullable is not added while setting up reacters. Seems like the created events is not fired just as @volkv said before.

Same goes for setting up reactants.