In the new PHP 8.1 version, you can use Enum classes. How would they work in Laravel? Let me show you an example.
Full repository: https://github.com/LaravelDaily/Larav...
Link to the Enum Pull Request: https://github.com/LaravelDaily/Larav...
PHP 8.1 Enums: https://stitcher.io/blog/php-enums
Enum casting in Laravel: https://laravel.com/docs/8.x/eloquent...
Twitter discussion about Enums: / 1468922708457136131
- - - - -
Support the channel by checking out premium products:
- Enroll in my Laravel courses: https://laraveldaily.teachable.com
- Try our Laravel QuickAdminPanel: https://bit.ly/quickadminpanel
- Buy my ready-made Laravel scripts: https://laraveldaily.gumroad.com
- Purchase my Livewire Kit: https://livewirekit.com
- Subscribe to my weekly newsletter: http://bit.ly/laravel-newsletter
Watch video Enum PHP 8.1 Classes in Laravel: Practical Example online without registration, duration hours minute second in high quality. This video was added by user Laravel Daily 24 January 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 29,533 once and liked it 697 people.