Комментарии:
nice thanks
Ответитьwould it not be easier to save those values in a database? because maybe changing the code to add one more attribute would be a little harder depending on the company, and adding a value to a table with a model would be easier, and maybe save some special data in the database as json to make it more flexible.
ОтветитьI have seen such Enums
ОтветитьMany thanks sir, I was very confused as to how to convert enum value to number (to save in database). The video is really helpful. Thank you
ОтветитьView classes etc in an Enum..
ОтветитьI like the helper methods, but the suggestion of putting CSS classes and/or HTML here just smells bad.
ОтветитьSir. Thanks for your videos. They really help me. Please i have a question. Why is it that in the MVC pattern sometimes the model handles some business logic. i thought that thats the responsibility of the controller
ОтветитьJust the video that I needed, at this point of time. Thank you so much.
Ответитьi add a trait to my enums for niceties like all(), sugar for cases()
ОтветитьКрасавчик, браво!👍
ОтветитьAllways used with logic inside enum. But enum with HLTML looks like suxx. It shoul be some wrapper for enum
ОтветитьSir , Is livewire is suitable for building large scalable application?
ОтветитьExcelent! Thanks Mr Povilas
ОтветитьUsed in almost all the project. One of my friend or mentor showed me this and from that day following the same approached.
ОтветитьIs that good code practising of putting constants into config folder as a file called constants.php
And when you need them call that values from config(‘constants.userState’) for example ??!!!
Please can anyone help
Having tailwind classes outside the views feels weird. But if you don't want to specifically add the classes you're using, you can just add the directory where your Enum class lives in the tailwind config file so it scans it as well.
ОтветитьI literally wanted to email you about this, couple if days ago. I did the same, I'm using enums wherever is possible, but wasn't sure if that the best approach. I used it for example for settings page, by listing all possible settings fields, and each field has some states like: is enabled, value, html (actually a call to blade's view), etc. So basically when I want to add another settings field, this is the place to start of.
ОтветитьGreat feature 👏👏👏👏👏
ОтветитьI also did a video on enums. But you managed to explain the advantages and possibilities in 5min whereas I took like 50 minutes :D
ОтветитьI have not used this yet but would like to add when we start using PHP 8 in older projects. Thanks for sharing the knowledge with us. ☺
Ответить