great list i follow the same structure, it’s easy to manage and the order makes sense.
@julienSibille14 күн бұрын
Whatever your prefer, consistency seems to be the key isn't it ?
@imqqmi15 күн бұрын
Validation, use form request or not. Use one resource controller per model and combine different functionality per user role or split it over multiple controllers or use middleware etc. And with API, use resource controller? If so remove unused routes with except on route? Use filtering options with URL encoded query parameters or do filtering in front end.
@8ack2Lobby15 күн бұрын
What about updating? columns like task status or is_completed? What is the best approach to update only the columns needed in update method. For example there is a tick icon button to mark it as completed. It should send request to update method to change is_completed to `true` right. But it shouldn't change any other columns. While on the other hand, when editing the task body or title we send the request to same update method. But we only want to change these columns. I know we can match to see what columns changed and update only the ones needed, but is that the best option we have?
@joshdevofficial15 күн бұрын
Use only helper
@JJ15ASMR15 күн бұрын
Typically, I wouldn't think that'd be an issue. You'd usually be using the `old()` helper to fill the inputs with the existing data so all columns would stay the same unless you actually edited those form inputs (since the entire record will be updated).
@8ack2Lobby15 күн бұрын
@@joshdevofficial hey can you elaborate on that pls, I don't get it.
@8ack2Lobby15 күн бұрын
@@JJ15ASMR 2 issues I forgot to mention. First one is, using different names for input that database. Is it secure to use the same names for input as it is in the database columns? because if we use different ones then we have to map them back first. The 2nd issue is related to doing extra things specifically related to a column. If I have a big table where multiple actions are performed based on the column changed then it becomes a mess. For example I may want to send notification after assigning a task if the assigned_to column is changed. And there are permissions to check also, if the user can assign or not, change status or edit this task or not. If all this is kept in the same update controller method. It gets messy and unreadable. I usually just create another controller method for these columns like assignTask, but is that good practice.
@LaravelDaily15 күн бұрын
I think that scenario is a good topic for a separate video, adding to my to-do list
@adolfomoram13 күн бұрын
How about views for edit and create vs modls? Which would be best for user experience?
@LaravelDaily12 күн бұрын
Personally, I hate modals. They add so much complexity and potential bugs.
@محمدابراهيم-ظ2ض15 күн бұрын
How to write Pest test function to test delete record when we used Soft Delete trait in Model.?
@LaravelDaily15 күн бұрын
From what I remember, there's assertSoftDeleted() method, no?
@marcelaodev15 күн бұрын
you can also assertdatabasehas deleted_date is null
@logudotcom4 күн бұрын
Thanks for sharing in detail.
@bagsmode15 күн бұрын
"It depends": an axiom I learned when playing poker for a living. Found that this is really a life axiom, can be applied to so many different areas.
@androwgamel320415 күн бұрын
Could you make video for how to convert laravel app to desktop app using electron js
@LaravelDaily15 күн бұрын
I haven't done it myself, so can't make a video, sorry.
@mouayedkeziz5314 күн бұрын
Native php is in beta but take a look at it.. it supports laravel
@mouayedkeziz5314 күн бұрын
I mean alpha
@youneschibouti455514 күн бұрын
Thank you for all works done for the laravel comunity. Why there is not a package for crud like breeze for authentication ? It would be very useful to have this functionality in laravel without installing a tierdparty pkg
@LaravelDaily14 күн бұрын
Because, as I showed you here, there are a lot of individual decisions which are PERSONAL preference. So which of those preferences that CRUD package would need to choose? That's why it's left for developers to decide how they want to build their CRUDs. And there are a lot of non-official CRUD generator packages, free and paid.
@heyykenn909914 күн бұрын
Can you also do a video on proper git commit history? For example, you generate a model, migration, request, controller, service, added route related to that model, and edited the view. Which should be grouped together? Model and migration as one commit? Then controller and request? Then web and view? Or which possible combination?
@LaravelDaily14 күн бұрын
In your case, it's a totally personal preference. Or preference of your team. The general idea is commit should represent something complete for review, ideally
@axect15 күн бұрын
Hello, I hope you see this comment, When we use Select multiple in Filamentphp, can we sort the data, can you shoot a video about it?
@LaravelDaily15 күн бұрын
Sort the data where - in the form dropdown or in the show values in the table? In both cases, you can modify queries, from what I remember.
@axect15 күн бұрын
@@LaravelDaily In FilamentPHP, when using the Select component with the ->multiple() method to allow multiple selections, is it possible to order these selections?
@LaravelDaily15 күн бұрын
Yes, you can define the options with custom Eloquent query where you can order however you want, just read the docs: filamentphp.com/docs/3.x/forms/fields/select#multi-select
@majid_alsaidi15 күн бұрын
Do you thing making QAP open source is a good idea? Maybe some one will fork it to support the new versions of laravel.
@LaravelDaily15 күн бұрын
It would be a ton of work to "polish" and prepare QAP for open-source, including documentation. Almost the same amount of work as re-build the new version.
@DanielŚmigiela13 күн бұрын
validation rules only in the array :) Then it's easier for me to use my own rules
@KeganVanSickle14 күн бұрын
This touches on a point for me. I like Laravel, a lot. However, I like opinionated frameworks. I like when things have one way to do it, and not 5, and clear standards. I'm just saying, it seems like there are a lot of things you can do in Laravel, that you shouldn't be doing, and I often find myself wasting time because there's no concrete rule. Being flexible, isn't always a good thing imo.
@edewaal9714 күн бұрын
I think mostly the Laravel docs show you the best way to do things. If it can be done another way, it's mostly legacy, but it still works. Same with recommendations online. If you read old articles, you will see old syntax which still works. The new and better way is however recommended. I learnt HTML and CSS a couple of years ago. Watching all the tutorials that learnt me how to use float and even a table layout is still pretty common in some longer tutorial series. A couple projects in I learnt the new CSS3 things like grid and flexbox, which made it so much easier to design a page. Float still works, but the new thing is just better and cleaner.
@LaravelDaily14 күн бұрын
It's a personal choice. For people who love more strictness and one-way-ness (is that even a word lol) Laravel is indeed not the best choice.
@KeganVanSickle14 күн бұрын
@@LaravelDaily Like I said, I do actually really like Laravel. Love is such a strong word. I don't know that I "love" any one framework. Haha. I really "like" Symfony as well. 😉
@rihulfaakbar226115 күн бұрын
Imo, storing data into db with laravel factory takes more time when you have complex relationship, I only use factory to make data and bulk insert it with some conditional count which is really faster than factory.
@silasmurithi470615 күн бұрын
Awesome!
@axect15 күн бұрын
Hi, why did you delete my comment on the previous video?
@LaravelDaily15 күн бұрын
I don't delete any comments, sometimes KZbin decides to not publish or hide some comments, I don't know the reason or if it's a KZbin bug
@axect15 күн бұрын
@@LaravelDaily Okey thank you.
@axect15 күн бұрын
@@LaravelDaily I will ask the question above in another comment