-
-
Notifications
You must be signed in to change notification settings - Fork 21
How it works
Pe Ell edited this page Apr 17, 2017
·
1 revision
Eloquent Flag is an easy way to add flagged attributes to eloquent models. All flags has their own trait which adds global scopes to desired entity.
There are 2 types of flags:
-
Boolean
flags are the common ones. Stored in database asBOOLEAN
orTINYINT(1)
value. -
Timestamp
flags represented in database as nullableTIMESTAMP
column. Useful when you need to know when action was performed.
All flags separated on 2 logical groups:
-
Classic
flags displays only entities withtrue
ortimestamp
flag value. -
Inverse
flags displays only entities withfalse
ornull
flag value.
Omitted entities could be retrieved by using special global scope methods, unique for each flag.