Laravel Model Flags is an awesome package that offers a trait that allows you to add flags to an Eloquent model. $user->hasFlag('receivedMail'); // returns false $user->flag('receivedMail'); // flag the user as having received the mail $user->hasFlag('receivedMail'); // returns true You can install the package via Composer: composer require spatie/laravel-model-flags Behind the scenes, the flags and their relation to a model will be stored in the flags table. To create that flags table, you must publish and run the migrations once with: php artisan vendor:publish --tag="model-flags-migrations" php artisan migrate
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners