laravel-enum
php-enum
laravel-enum | php-enum | |
---|---|---|
3 | 2 | |
1,976 | 2,714 | |
- | 0.2% | |
6.9 | 3.2 | |
about 2 months ago | 3 months ago | |
PHP | PHP | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
laravel-enum
-
How to Use Laravel Rules
Suppose we have a Permission enum in our Laravel project, and when an admin assigns a permission to a user, we need to verify if the permission is valid. To accomplish this, we'll create the Permission enum using BenSampo/laravel-enum package:
-
Laravel enum tips!!
About Laravel Enum
-
Suggestions for improvement to lookup table
I use this laravel-enum package, Spatie has one that I'm sure is great as well. Have you checked out how they do things to see if there are any takeaways? They're a different approach because the list of enums aren't stored in the database, which I really like because it means I can get the enum types and values autocompleted in my IDE. There are also some convenient features like attribute casting and validation rules.
php-enum
-
Weekly "ask anything" thread
My understanding of the new PHP enums are that they provide a first-class citizen for enum patterns in userland that are extremely common. For example, there is a popular enum library https://github.com/myclabs/php-enum. But many people craft these by hand in their projects. The main idea is to provide an abstraction over "strings that inform business logic" for lack of a better term.
-
My opinion on the PHP 8.1 Enum RFC
This feature alone would likely cause me to drop myclabs/php-enum as my enum implementation.
What are some alternatives?
sushi - Eloquent's missing "array" driver.
php-enum - Simple and fast implementation of enumerations with native PHP
enum - Strongly typed enums in PHP supporting autocompletion and refactoring
attributary - A library for PHP 8 Attribute developers. This library gives developers a similar experience to the Doctrine/Annotation library.
laravel-mysql-spatial - MySQL Spatial Data Extension integration with Laravel.
laravel-fpdf - Create PDFs with Laravel, provides FPDF version 1.86
bouncer - Laravel Eloquent roles and abilities.
laravel-database-emails - Store e-mails in the database and send them using a cronjob
laravel-form-builder - Laravel Form builder for version 5+!
nepali-calendar - 📅 Date converter with more features ( adding months to date, adding days to date , get current date etc. ) . Supports BS and AD date type.