Top 5 Laravel "Bad Practices" (My Opinion)

  Рет қаралды 15,011

Laravel Daily

Laravel Daily

Күн бұрын

I compiled the things that I consider a performance/security issue, let's talk about them.
Full article: laraveldaily.com/post/laravel...
- - - - -
Support the channel by checking out my products:
- My Laravel courses: laraveldaily.com/courses
- Filament examples: filamentexamples.com
- Livewire Kit Components: livewirekit.com
- - - - -
Other places to follow:
- My weekly Laravel newsletter: us11.campaign-archive.com/hom...
- My personal Twitter: / povilaskorop

Пікірлер: 49
@mylesduncanking
@mylesduncanking 15 күн бұрын
7:55 "the overall message is, always validate the data from your users and never EVER trust them" ... words to live by!
@Claudio_Pereira
@Claudio_Pereira 15 күн бұрын
Povilas, could you create a version of this article focusing on Filament. A "Top 'n' Filament Bad Practices" would be very welcome. A full course, perhaps, could emerge from this? 😊
@LaravelDaily
@LaravelDaily 15 күн бұрын
Something to think about :) thanks for the idea
@user-ir6lv2nq8i
@user-ir6lv2nq8i 15 күн бұрын
Bad Practice N. Not Subscribing to Laravel Daily.
@Claudio_Pereira
@Claudio_Pereira 15 күн бұрын
I totally agree with you 😃
@eslammostafa1247
@eslammostafa1247 14 күн бұрын
Thank you, that's really helpful
@shrikantdharam5550
@shrikantdharam5550 13 күн бұрын
I worked on 3cr+ data in a single table. It is also important to db partition and indexing. Also do not use any hashing in where clause like md5(). Also use cache mechanism By implementing these practice, data retrieval and manipulation become more streamlined, ensuring smooth and efficient database operations even at a large scale.
@kennedymwenda3357
@kennedymwenda3357 15 күн бұрын
What do you use to write programming E-books?. People recommend Markdown but I find it cumbersome to think about its syntax as well the content you are writing
@LaravelDaily
@LaravelDaily 15 күн бұрын
Yes I write in Markdown, got used to it. In Sublime text as editor. Early notes or plans I write in Google keep, without markdown there.
@olivierperrier114
@olivierperrier114 15 күн бұрын
I love the vintage design of your gum road website! One more bad practice I saw in projects in querying data directly from the view like {{ \App\Models\Posts:: newest()->limits(10)-get() }} in blade components
@LaravelDaily
@LaravelDaily 15 күн бұрын
Yes, the violation of MVC became a "not so bad" practice and it's mentioned among the 17 in the tutorial. It used to be bad practice but then they released Livewire Volt... And turned MVC upside down :) With vintage theme, it's actually default gumroad :)
@LoganathanNatarajanlogudotcom
@LoganathanNatarajanlogudotcom 7 күн бұрын
thank you .. Long waited tips..
@bumblebity2902
@bumblebity2902 12 күн бұрын
When you made video course about the one and only "clean architecture" on Laravel?
@LaravelDaily
@LaravelDaily 11 күн бұрын
When the one and only clean architecture is invented :) There are many architecture options. I've talked about them in courses like "How to structure Laravel projects" or "SOLID code in Laravel", and others.
@bumblebity2902
@bumblebity2902 11 күн бұрын
@@LaravelDaily Clean architecture takes project structure to the next level. OOP and SOLID taking to the perfection with strict separation of concerns
@stojankukrika7242
@stojankukrika7242 14 күн бұрын
My "Bad practice" I used at the start of the product was to create all kinds of pricing with zero(around 9k pricing combinations with pricing plans and service plans). Now need to find a way to refactor it to stop creating that large amount of pricing without breaking the complete project. Because now those are the biggest tables in the project :(
@faiz3711
@faiz3711 14 күн бұрын
I'm guilty of sending back error code with 200 code with the message of the error, i don't know where i picked it up or started doing it. I even infected my Codeium AI helper with this disease
@JarkkoHautakorpi
@JarkkoHautakorpi 6 күн бұрын
I just throw an exception, or let it be thrown and let Laravel return it, be it the api route or front route 😀
@UsmanAli-yv6vo
@UsmanAli-yv6vo 15 күн бұрын
Hey do you recommend Octane? How can we use it?
@LaravelDaily
@LaravelDaily 14 күн бұрын
You need this fresh video by Aaron Francis: kzfaq.info/get/bejne/j61yqcdyvNqUh2w.htmlsi=zXo9YF-rVy04wNeY
@UsmanAli-yv6vo
@UsmanAli-yv6vo 14 күн бұрын
@@LaravelDaily I have watched his video with some other videos but that's all just theory there isn't any detail tutorial to use octane in an actual Laravel working application
@LaravelDaily
@LaravelDaily 14 күн бұрын
Because almost no one is actually using it. 99.9% projects don't need that kind of boost, the performance problems are usually inside the app. But you can Google something from spatie, I remember they mentioned using octane but don't remember if they released tutorials about it.
@UsmanAli-yv6vo
@UsmanAli-yv6vo 14 күн бұрын
@@LaravelDaily thanks
@jurajrydzi8554
@jurajrydzi8554 15 күн бұрын
i think you shoud add another bad practise: especially in public method array as parameter it's bad for readeability and its shoud be replaced by object or DTO
@yungifez
@yungifez 15 күн бұрын
When your company's codebsse is guilty of all these😂😂
@harshmudhar96
@harshmudhar96 14 күн бұрын
What is your company's product? Asking for a friend.
@yungifez
@yungifez 14 күн бұрын
@harshmudhar96 only thing I can say is its animation related
@droidTV-ij4ct
@droidTV-ij4ct 5 күн бұрын
Can you provide the link to your project?!
@yungifez
@yungifez 5 күн бұрын
@droidTV-ij4ct oh sorry I can't NDA
@turculaurentiu91
@turculaurentiu91 15 күн бұрын
What do you mean 2xx response with error inside is bad? It successfully retrieved the error!
@pablo1gustavo
@pablo1gustavo 15 күн бұрын
😂
@amra-dev
@amra-dev 15 күн бұрын
2xx - success 4xx - client error 5xx - server error
@jdrab
@jdrab 15 күн бұрын
you forgot the tags :D somebody already obviously didn't understand.
@heitorasf
@heitorasf 15 күн бұрын
😂😂😂 Joker
@1234matthewjohnson
@1234matthewjohnson 15 күн бұрын
Hahaha
@youness_boualam
@youness_boualam 15 күн бұрын
Not using Authorization for actions, is also considered as bad practice
@bumblebity2902
@bumblebity2902 12 күн бұрын
For what kind of actions?
@youness_boualam
@youness_boualam 12 күн бұрын
​@@bumblebity2902 It could be either Controller actions or Livewire actions. Imagine this situation: we have a URL like /store/1/show, where we display a store using its ID. If we didn't set up authorization for the "show" method, I could just change the ID in the URL to something else and see a different store that isn't mine. Another situation could happen with Livewire. For example, we have something like wire:click="delete(1)". I could easily right-click and choose "inspect element", then change it to wire:click="delete(2)", and this action would be performed instead.
@Sergii.Pravdzivyi
@Sergii.Pravdzivyi 5 күн бұрын
Bad practice: applying htmlentities() twice instead of just once. Check your article page title ;)
@LaravelDaily
@LaravelDaily 4 күн бұрын
Thank you, well noticed! :) Fixed now.
@spicynoodle7419
@spicynoodle7419 15 күн бұрын
Bad practice: not using DI container for binding preconfigured instances. I've seen $stripe = new \Stripe\StripeClient(config('stripe.api_secret')); way too many times man. Another bad practice is using env() directly in your code without having a dedicated config in config/foobar.php. Just like not using DI, it makes overriding stuff more difficult. Especially when libraries do it, this is terrible
@LaravelDaily
@LaravelDaily 15 күн бұрын
The second one is included in the list in the article. The first one is pretty rare and does have that big impact imho.
@brunosilva-ed4pz
@brunosilva-ed4pz 15 күн бұрын
U would cry if i saw the code that my company writes... (I do every day...)
@sherzodqudratov193
@sherzodqudratov193 15 күн бұрын
yeap, is_admin = 1 xD
@JarkkoHautakorpi
@JarkkoHautakorpi 6 күн бұрын
... put the is_admin=0 into cookie and then use it from there 🤣
@johnnyw525
@johnnyw525 12 күн бұрын
Why would you gracefully hide a serious system error (a model didn’t exist where it should)? If the system is broken, fix the system. Don’t hide the error!
What is Laravel Octane?
8:34
Aaron Francis
Рет қаралды 24 М.
Refactor "Senior" PHP Code with Early Returns
12:09
Laravel Daily
Рет қаралды 24 М.
ШЕЛБИЛАР | bayGUYS
24:45
bayGUYS
Рет қаралды 632 М.
Мама забыла взять трубочку для колы
00:25
Даша Боровик
Рет қаралды 2,2 МЛН
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 154 М.
Serverless PHP is pretty good
12:33
Andrew Schmelyun
Рет қаралды 5 М.
Eloquent where(): 6 "Tricks" You May Not Know
5:44
Laravel Daily
Рет қаралды 7 М.
Static Methods in Laravel/PHP: When and How?
10:39
Laravel Daily
Рет қаралды 16 М.
INSANE OpenAI News: GPT-4o and your own AI partner
28:48
AI Search
Рет қаралды 471 М.
Laravel: Avoid Try-Catch In Every Method (What To Do Instead)
4:45
Laravel Daily
Рет қаралды 25 М.
Good APIs Vs Bad APIs: 7 Tips for API Design
5:48
ByteByteGo
Рет қаралды 191 М.
23 CSS features you should know (and be using) by now
31:31
Kevin Powell
Рет қаралды 52 М.
Interview With A Sr JavaScript Dev | Prime Reacts
24:43
ThePrimeTime
Рет қаралды 145 М.
ЧТО В НАБОРЕ?
1:01
Li ALINA
Рет қаралды 2,5 МЛН
スマッシュBINGO
0:59
卓キチちゃんねる
Рет қаралды 50 МЛН
Eraser tests
1:00
Money Saving Man
Рет қаралды 14 МЛН