4 Tips to Improve Leah's Laravel Code

  Рет қаралды 9,340

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 31
@TheCodeholic
@TheCodeholic 2 ай бұрын
Getting outside of comfort zone is very hard, so bravo to Leah for starting her journey publicly. I personally become nervious even only imagining doing live coding and I not remembering something or not knowing very basic thing. I think I need to work on this.
@minthantoo3509
@minthantoo3509 2 ай бұрын
The legend here!
@nerisonpitogo3314
@nerisonpitogo3314 2 ай бұрын
yoh bro. Ive used your codeholic THECODEHOLIC hostinger coupon a million times already. :)
@andrewmcburney4425
@andrewmcburney4425 11 күн бұрын
Super helpful video! thanks for taking the time to review it. I am coming from a node/react background and jumping into Laravel and really enjoying it. Hearing your thoughts on best practice on certain things is invaluable.
@TalesGrechi
@TalesGrechi 2 ай бұрын
I remember that I did a lot of these "Model::all()" mistakes in the past, too... Great video!
@saravanasai2391
@saravanasai2391 2 ай бұрын
That was really a great review & constructive suggestions. I have seen some videos just roasting the creator for their code. Great job keep doing it.
@bumblebity2902
@bumblebity2902 2 ай бұрын
In the companies participating for junior positions you get tough love reviews.
@aleAmosin
@aleAmosin 2 ай бұрын
A while ago, I started using Model::query()->find($id) instead of Model::find($id). It's more verbose, but I gain the benefit of autocomplete and IDE intellisense, as it knows that find returns the model and not a mixed type.
@edgarsloskots2617
@edgarsloskots2617 2 ай бұрын
My favorite sentence - “What if you have 1M problems in your database”? 😅
@taraqrahman7171
@taraqrahman7171 2 ай бұрын
Thank you. This is what I want. Please keep this forword.
@p30mehrdad
@p30mehrdad 2 ай бұрын
with this code review you did the great job. thank you.🌹
@zkabadu
@zkabadu 2 ай бұрын
She could also return the return value of Quit::create() as the latest created model instead of dismissing the value and fetching it again from the database.
@emmanuelsiziba5142
@emmanuelsiziba5142 2 ай бұрын
Learnt something new... Esp about methods in controller rather than model
@bumblebity2902
@bumblebity2902 2 ай бұрын
Kudos for Lady courage.
@aimperialdesign6519
@aimperialdesign6519 2 ай бұрын
I have also new project. If want to post it, wouldn't it affect exposing the code?! The project was used during the Miss Tabuk 2024 and I'm currently making the version 2 to do users feedback. What ja think?
@LaravelDaily
@LaravelDaily 2 ай бұрын
Depends on what and how you expose, there are different projects, no single rule for this.
@aimperialdesign6519
@aimperialdesign6519 2 ай бұрын
​​@@LaravelDaily I've learned a lot from you. So, I refactor the queries. Would it be good if I'll show it in public when it will be used by the community? I'm new to web development. I'm starting to learn PHP and JS both without framework but halted due to have to rush the project. And tried Laravel based on my VB knowledge. So, I don't I actually know most of your coding style previously because I tried eloquent from the start. My controllers have bunch of codes while yours are just few lines. But still manage to made it work well and load efficient for some maybe.
@LaravelDaily
@LaravelDaily 2 ай бұрын
I don't really understand the question. Where do you want to show it and how? You don't need MY permission to show your code somewhere :)
@IlPandax
@IlPandax 2 ай бұрын
I really like these tips, BUT, be cautious when using "fresh" because if you have other tables in the DB you are using for your laravel tables (for whatever reason), they will ALL be deleted, not only laravel tables.
@shahsawoodshinwari
@shahsawoodshinwari 2 ай бұрын
Actually i am not a fan of things to do in services instead i do that in models and have my dedicated package called Laravel trait generator which generates those traits fir me.
@chlouis-girardot
@chlouis-girardot 2 ай бұрын
Maybe : a rule with pest arch to not allowed "all()" method on Eloquent Model ?
@LaravelDaily
@LaravelDaily 2 ай бұрын
But the same would apply to ->get()->where(), not only all(). But yeah, maybe something is possible to build via custom Pest arch tests.
@drewbertola
@drewbertola 2 ай бұрын
(@ 2:03) You would actually prefer this outside of the controller? Traditionally the controller is for business logic, not just a proxy for a crud model. I'd hate to go into code that buried business logic deeper because it didn't match a CRUD operation.
@LaravelDaily
@LaravelDaily 2 ай бұрын
Controller is for business logic? Maybe you're coming from other framework/language? In Laravel, the goal of controller is to, well, CONTROL, get the parameters, call the logic methods, return the results.
@MrDhump
@MrDhump Ай бұрын
​@@LaravelDaily correct, like in your other video I commented that "routes are meant to just.. route", likewise as the name suggests, controller purpose is to just control 😊
@Reeves_77
@Reeves_77 2 ай бұрын
laravel telescope
@JamesAutoDude
@JamesAutoDude 2 ай бұрын
Personally I think all her problems would be solved with utilities lol
@ゲンスルー-g2q
@ゲンスルー-g2q 2 ай бұрын
It's time to kindly assert some authority as a Laravel influencer to the rookie.
@LaravelDaily
@LaravelDaily 2 ай бұрын
I was trying to not go with authority, rather with helping hand. And I asked Leah's permission before shooting this video.
Laravel Conventions/Guidelines from IxDF
9:40
Laravel Daily
Рет қаралды 5 М.
Junior Code Review: 5 Tips for Over-Engineered Example
12:51
Laravel Daily
Рет қаралды 6 М.
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
18 Laravel/PHP Tips in 10 Minutes: June 2024
10:41
Laravel Daily
Рет қаралды 10 М.
4 Problems with Eloquent Soft Deletes (and Two Alternatives)
9:05
Laravel Daily
Рет қаралды 12 М.
Eloquent: Two HUGE Performance Mistakes
6:37
Laravel Daily
Рет қаралды 9 М.
Significantly Improve Page Loads Using Laravel Prefetching
9:12
Laravel Roles/Permissions: Complex Multi-Clinic Project
13:03
Laravel Daily
Рет қаралды 11 М.
4 Tips for Dev Productivity (I've tried many techniques...)
9:01
Laravel Daily
Рет қаралды 6 М.
9 Laravel/PHP Tips in 8 Minutes: September 2024
8:45
Laravel Daily
Рет қаралды 6 М.
How to OVER Engineer a Website // What is a Tech Stack?
11:20
Fireship
Рет қаралды 2,5 МЛН
We Love PHP Attributes
10:02
Laravel
Рет қаралды 12 М.