Second that; there is a common pattern, where a binary state (active/inactive, deleted/ not deleted, archived/not-archived) could be achieved with a timestamp - which in our case not only tells the admin since when the user is banned, but also allows for un-banning after, say a month.
And then the name of the field becomes banned_at and the rest of inspiration should come from SoftDeletes trait
I understand this is a Middleware example, so 1/0 is a good starting point; it just can be extended.
i think i would prefer saving banned users with time
I think this is Just for starting point, you can always extend it according to your use case.
Second that; there is a common pattern, where a binary state (active/inactive, deleted/ not deleted, archived/not-archived) could be achieved with a timestamp - which in our case not only tells the admin since when the user is banned, but also allows for un-banning after, say a month.
And then the name of the field becomes
banned_at
and the rest of inspiration should come fromSoftDeletes
traitI understand this is a Middleware example, so 1/0 is a good starting point; it just can be extended.
Well That's correct Thanks for detailed comment. @cyrillkalita