-
-
Notifications
You must be signed in to change notification settings - Fork 20
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:
-
Booleanflags are the common ones. Stored in database asBOOLEANorTINYINT(1)value. -
Timestampflags represented in database as nullableTIMESTAMPcolumn. Useful when you need to know when action was performed.
All flags separated on 2 logical groups:
-
Classicflags displays only entities withtrueortimestampflag value. -
Inverseflags displays only entities withfalseornullflag value.
Omitted entities could be retrieved by using special global scope methods, unique for each flag.