No video

Junior Laravel Developer Code Review - Reviewing Routes, Migrations, Models & Controllers in Laravel

  Рет қаралды 4,903

Code With Dary

Code With Dary

Күн бұрын

Пікірлер: 62
@codewithdary
@codewithdary Жыл бұрын
Do you think I should create more code review tutorials? Let me know! Follow me or subscribe to my newsletter to get notified when my course is released: - Twitter: twitter.com/codewithdary - Instagram: instagram.com/codewithdary/ - Blog: blog.codewithdary.com/
@jackelofnar
@jackelofnar Жыл бұрын
Hi Dary, I hope you continue with this series as someone who is still learning Laravel you gave alotof great tips.
@codewithdary
@codewithdary Жыл бұрын
Thank you Jack! If the video performs well (and it's doing right now) I will definitely continue on making more of these!
@Tux0xFF
@Tux0xFF Жыл бұрын
This channel is a goldmine, you dont get to see these type of reviews and content unless its premium content, glad that i found it
@codewithdary
@codewithdary Жыл бұрын
Thank you so much for the compliments, means the world to me
@baochungpro1996
@baochungpro1996 Жыл бұрын
Great, please continue with this kinda series. Thanks so much, Dary.
@codewithdary
@codewithdary Жыл бұрын
Will do, thank you so much!
@petermwangi7274
@petermwangi7274 Жыл бұрын
Much informative Dary. Definitely looking to more of your code review tutorials.
@codewithdary
@codewithdary Жыл бұрын
Thanks, will do Peter!
@basharumar2912
@basharumar2912 Жыл бұрын
promise fulfilled! Thank you mr Dary and looking forward to having more tutorials like this.
@codewithdary
@codewithdary Жыл бұрын
Appreciate the kind words Bashar. If it performs well, I will definitely continue on making content like this!
@waleedgrt4904
@waleedgrt4904 Жыл бұрын
Hey Dary, At 22:33, the "validated" method is more convenient than the "only" method.
@codewithdary
@codewithdary Жыл бұрын
Both options work fine, there isn't a right or wrong right here, I'm just not really a fan of it. I prefer to explicitly define and insert data into the database. Completely fine using the other method.
@b3rking
@b3rking Жыл бұрын
Hello dary, thanks for the review and for the corrections, i'll make sure to apply them in my next versions. Again thanks a lot, it means a lot. Keep it up!
@codewithdary
@codewithdary Жыл бұрын
Appreciate it, keep on going with the good work!!
@GavinKimpson
@GavinKimpson Жыл бұрын
Dude your videos are great, you'll be at 100k subscribers in no time!
@codewithdary
@codewithdary Жыл бұрын
Thank you so much Gavin, I hope so!!
@user-rv5rm1yl1g
@user-rv5rm1yl1g 10 ай бұрын
That's a good video! But I have a few points that concerns me. If you injected FormRequest class instead of general Request, then you don't need to call "$request->validated()" to trigger validation. It would be taken care of by Laravel itself. I think it's not a good point to use "auth()" helper inside any models function - it seem not obvious and has it's own issues. I would use "$this" instead. For me it seem more convenient.
@codewithdary
@codewithdary 10 ай бұрын
Yes, that is true in Laravel. If you inject a FormRequest class instead of the general Request class, you don't need to call "$request->validated()" to trigger validation. Laravel automatically handles the validation process when using FormRequest classes.
@grzesiekb9142
@grzesiekb9142 Жыл бұрын
$request->validated() returns only validated fields. You can safly use $model->update( $request->validated() ) i think...
@codewithdary
@codewithdary Жыл бұрын
That is correct. The source code will not get into the method if the validation passes, so it does not really matter whether you use the $request validated or the values directly.
@DCBlogdev
@DCBlogdev Жыл бұрын
brilliant video 👏
@codewithdary
@codewithdary Жыл бұрын
Appreciate it David, especially coming from you!
@basharumar2912
@basharumar2912 Жыл бұрын
i hope one day you will teach us more about the difference between policies and guardes,listeners and observers etc.
@codewithdary
@codewithdary Жыл бұрын
Will do in the future!!
@newtonjob7611
@newtonjob7611 Жыл бұрын
@avfr Observers are simply listeners for model events. You can't choose to use one or the other. You also cannot manually fire model events from a controller, since they're internally fired by eloquent.
@igerardogc
@igerardogc Жыл бұрын
What theme, font and spacing are u using? Nice video
@codewithdary
@codewithdary Жыл бұрын
Theme: SynthWave 84 (Material) Font: Monaco Line height: 1.4
@ricardozapanta6656
@ricardozapanta6656 3 ай бұрын
Hi Dary what extension do you use to see what type of the value needed inside the parameters ex: $table->string(column: 'extension'); the "column""
@jjplays404
@jjplays404 Жыл бұрын
at 8:45, how your methods are showing key like $table->string(column: "something") which extension you are using to show "column" thing?
@basharumar2912
@basharumar2912 Жыл бұрын
what is the difference between using foreign or foreignID and which is better?
@codewithdary
@codewithdary Жыл бұрын
The main difference between the two methods is that foreignId() is a shorthand method that automatically creates a column with an unsigned big integer data type and adds the foreign key constraint to that column. This can simplify the syntax of creating a foreign key constraint.
@ramzibenssaci2007
@ramzibenssaci2007 7 ай бұрын
thank you dary i have simple question why you sometimes use ->value and sometimes not i means in enum
@codewithdary
@codewithdary 7 ай бұрын
The ->value method is used to retrieve the underlying value of an enum instance. Enums in Laravel are implemented as objects, and ->value allows you to access the actual value stored within the enum rather than the enum object itself!
@MightyKingKala
@MightyKingKala Жыл бұрын
Amazing video thanks
@codewithdary
@codewithdary Жыл бұрын
Glad you enjoyed it Isaac!
@abukhalid5890
@abukhalid5890 Жыл бұрын
putting $guarded=[] (empty array) in the model is same as $fillable=[..all request keys here..] and i think you cant put both of these two variables in the same model
@codewithdary
@codewithdary Жыл бұрын
I'm pretty sure you can't because these two properties are used to specify which attributes are mass assignable and which are not, respectively. Well, you technically can, but Laravel will prioritize $guarded and ignore $fillable, which could lead to unexpected behavior in your application.
@tharakadoo
@tharakadoo Жыл бұрын
Hey Dary big fan
@codewithdary
@codewithdary Жыл бұрын
Thank you so much Tara
@pauliusjankauskas8028
@pauliusjankauskas8028 Жыл бұрын
Why do need $request->validated() in controller since it returns validated data from request? Doesn't validation happen automatically?
@codewithdary
@codewithdary Жыл бұрын
That works too, just not a fan of using so many things behind the scenes :)
@codewithdary
@codewithdary Жыл бұрын
Quick add on btw; I'm reviewing code how I should do it, not saying that it's the best way, just my way.
@pauliusjankauskas8028
@pauliusjankauskas8028 Жыл бұрын
Yap, there is no best way to do it. Need to make a choice from many ways for particual situation.
@pauliusjankauskas8028
@pauliusjankauskas8028 Жыл бұрын
Just was wondering if didn't make a typo, because as i knew $request->validated() returns only validated data from a request and not do validation it self. For validation, i was using $request->validate().
@grzesiekb9142
@grzesiekb9142 Жыл бұрын
@@codewithdary If I understand correctly validation as a formrequest then the data is always validated behind the scenes. When you use request->validated() then you only return validated data but you don't assign it anywhere. It makes no sense to me to use this method in your example.
@REAZNx
@REAZNx Жыл бұрын
6:22 Locale is pronounced “low-kal” 🙂
@codewithdary
@codewithdary Жыл бұрын
Thank you Lewis. Sounds like low-kal-ories 😜
@newtonjob7611
@newtonjob7611 Жыл бұрын
Is there really such a method as `required` on the ColumnDefinition? Never heard of it 🤔
@codewithdary
@codewithdary Жыл бұрын
Whoops no, I was a bit mixed-up with another framework, sorry for that!
@karlson2804
@karlson2804 Жыл бұрын
Wery nice👍🫡
@codewithdary
@codewithdary Жыл бұрын
Thank you so much Karl
Junior Code Review: Laravel Routes, Middleware, Validation and more
19:57
а ты любишь париться?
00:41
KATYA KLON LIFE
Рет қаралды 2,9 МЛН
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 39 МЛН
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 937 М.
Become a PRO at Using Components in Laravel
32:51
Code With Dary
Рет қаралды 36 М.
Laravel Junior Code Review: 12 Tips on Everything
15:30
Laravel Daily
Рет қаралды 74 М.
Do NOT Learn Kubernetes Without Knowing These Concepts...
13:01
Travis Media
Рет қаралды 270 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 145 М.
I forced EVERYONE to use Linux
22:59
NetworkChuck
Рет қаралды 406 М.
Junior Code Review: Cleaning Up Laravel CRUD
14:54
Laravel Daily
Рет қаралды 68 М.
а ты любишь париться?
00:41
KATYA KLON LIFE
Рет қаралды 2,9 МЛН