Laravel CRUD: 15+ Questions to Solve

  Рет қаралды 5,521

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 42
@adamcalleja9815
@adamcalleja9815 10 күн бұрын
great list i follow the same structure, it’s easy to manage and the order makes sense.
@julienSibille
@julienSibille 14 күн бұрын
Whatever your prefer, consistency seems to be the key isn't it ?
@imqqmi
@imqqmi 15 күн бұрын
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.
@8ack2Lobby
@8ack2Lobby 15 күн бұрын
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?
@joshdevofficial
@joshdevofficial 15 күн бұрын
Use only helper
@JJ15ASMR
@JJ15ASMR 15 күн бұрын
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).
@8ack2Lobby
@8ack2Lobby 15 күн бұрын
@@joshdevofficial hey can you elaborate on that pls, I don't get it.
@8ack2Lobby
@8ack2Lobby 15 күн бұрын
@@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.
@LaravelDaily
@LaravelDaily 15 күн бұрын
I think that scenario is a good topic for a separate video, adding to my to-do list
@adolfomoram
@adolfomoram 13 күн бұрын
How about views for edit and create vs modls? Which would be best for user experience?
@LaravelDaily
@LaravelDaily 12 күн бұрын
Personally, I hate modals. They add so much complexity and potential bugs.
@محمدابراهيم-ظ2ض
@محمدابراهيم-ظ2ض 15 күн бұрын
How to write Pest test function to test delete record when we used Soft Delete trait in Model.?
@LaravelDaily
@LaravelDaily 15 күн бұрын
From what I remember, there's assertSoftDeleted() method, no?
@marcelaodev
@marcelaodev 15 күн бұрын
you can also assertdatabasehas deleted_date is null
@logudotcom
@logudotcom 4 күн бұрын
Thanks for sharing in detail.
@bagsmode
@bagsmode 15 күн бұрын
"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.
@androwgamel3204
@androwgamel3204 15 күн бұрын
Could you make video for how to convert laravel app to desktop app using electron js
@LaravelDaily
@LaravelDaily 15 күн бұрын
I haven't done it myself, so can't make a video, sorry.
@mouayedkeziz53
@mouayedkeziz53 14 күн бұрын
Native php is in beta but take a look at it.. it supports laravel
@mouayedkeziz53
@mouayedkeziz53 14 күн бұрын
I mean alpha
@youneschibouti4555
@youneschibouti4555 14 күн бұрын
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
@LaravelDaily
@LaravelDaily 14 күн бұрын
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.
@heyykenn9099
@heyykenn9099 14 күн бұрын
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?
@LaravelDaily
@LaravelDaily 14 күн бұрын
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
@axect
@axect 15 күн бұрын
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?
@LaravelDaily
@LaravelDaily 15 күн бұрын
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.
@axect
@axect 15 күн бұрын
@@LaravelDaily In FilamentPHP, when using the Select component with the ->multiple() method to allow multiple selections, is it possible to order these selections?
@LaravelDaily
@LaravelDaily 15 күн бұрын
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_alsaidi
@majid_alsaidi 15 күн бұрын
Do you thing making QAP open source is a good idea? Maybe some one will fork it to support the new versions of laravel.
@LaravelDaily
@LaravelDaily 15 күн бұрын
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Śmigiela
@DanielŚmigiela 13 күн бұрын
validation rules only in the array :) Then it's easier for me to use my own rules
@KeganVanSickle
@KeganVanSickle 14 күн бұрын
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.
@edewaal97
@edewaal97 14 күн бұрын
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.
@LaravelDaily
@LaravelDaily 14 күн бұрын
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.
@KeganVanSickle
@KeganVanSickle 14 күн бұрын
@@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. 😉
@rihulfaakbar2261
@rihulfaakbar2261 15 күн бұрын
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.
@silasmurithi4706
@silasmurithi4706 15 күн бұрын
Awesome!
@axect
@axect 15 күн бұрын
Hi, why did you delete my comment on the previous video?
@LaravelDaily
@LaravelDaily 15 күн бұрын
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
@axect
@axect 15 күн бұрын
@@LaravelDaily Okey thank you.
@axect
@axect 15 күн бұрын
@@LaravelDaily I will ask the question above in another comment
Cursor AI for Laravel: Hotel Booking Project (Part 1)
21:24
Laravel Daily
Рет қаралды 9 М.
NEW: Laravel Project Examples - 5 CRUDs with Different Stack
12:27
Laravel Daily
Рет қаралды 3,4 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Advanced PHP: Generics Explained
6:15
Nuno Maduro
Рет қаралды 4,2 М.
Laravel background Jobs #laravel #php
11:29
Azizdev
Рет қаралды 132
What Senior Devs ACTUALLY Do? (And how to become one)
7:12
Laravel Daily
Рет қаралды 2,4 М.
Laravel CRUD: Multiple Update Forms - Separate Controllers?
7:48
Laravel Daily
Рет қаралды 3,1 М.
Laravel vs React
9:40
Aaron Francis
Рет қаралды 70 М.
How to implement RBAC in Laravel
14:52
JustSteveKing
Рет қаралды 3 М.
Laravel Gems - Pipelines 💎
15:21
Laravel
Рет қаралды 12 М.
4 Problems with Eloquent Soft Deletes (and Two Alternatives)
9:05
Laravel Daily
Рет қаралды 15 М.
Laravel Roles/Permissions: Complex Multi-Clinic Project
13:03
Laravel Daily
Рет қаралды 12 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН