9 Laravel/PHP Tips in 8 Minutes: September 2024

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

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер
@VadimBesedin
@VadimBesedin 2 ай бұрын
One more Tip: Add comments to model's fillable array items - this way you will always know what those properties are used for. Like: protected $fillable = [ 'interactions', // count of user's interactions with other users and bots ];
@alighanati5453
@alighanati5453 2 ай бұрын
thank you for this great tips, i liked conditionable and whereRelation, it's amazing there are multiple ways to do things
@yezperdk
@yezperdk 2 ай бұрын
Tip on grouping table columns - absolutely, do this when creating the table! But you won't be able to keep the nice order if you're using PostgreSQL and need to add a new field down the line. If you want to add the field in its logical group, you'll need to dump then recreate the table with the new field and import data. Or create a view that returns fields in the desired order.
@SilverPaladin
@SilverPaladin 23 күн бұрын
This grouping is only for making it easy to understand when you are reviewing the migration, and not really about column order in the database schema.
@SilverPaladin
@SilverPaladin 23 күн бұрын
With the User::select('id','name) you can also do Posts::with('user:id,name') to eager load specific related columns
@eyemazed
@eyemazed 2 ай бұрын
being able to override the random function return value with a predefined constant feels so wrong on so many levels
@mayanksgajjar
@mayanksgajjar 2 ай бұрын
Thank you for the tips, whereRelation must be very useful as we need to test it before we can use it.
@אקרמיצאלח
@אקרמיצאלח 2 ай бұрын
Where relation tips is insane I'll try it, thanks to the guy who made the video
@nielskok2935
@nielskok2935 2 ай бұрын
@2:31 does sync still work when having multiple relations like this? I sometimes notice that entries from the other relation gets deleted when syncing
@LaravelDaily
@LaravelDaily 2 ай бұрын
Not sure, can't answer without debugging the specific scenario
@jonwinder1861
@jonwinder1861 2 ай бұрын
working with YII 1 at the moment for work. Having laravel withdrawals everyday.
@JonnyJKF
@JonnyJKF 2 ай бұрын
Hot take: Yii 1 was better than its contemporary Laravel versions - but it's very old now! It was very powerful and productive out the box without installing any 3rd party tools and the official documentation told you everything you needed to know in a format accessible to beginners.
@yadindominguez1027
@yadindominguez1027 2 ай бұрын
I have a doubt: i have seen that recently the creation of components is used more when creating layouts and extending content between pages in Laravel and not so much using the @yield @extends and @sections directives, from your perspective do you think that has changed? Is there a "better approach" to these two points of view or are they complementary?
@LaravelDaily
@LaravelDaily 2 ай бұрын
It's a personal preference, either way is fine
@373323
@373323 2 ай бұрын
yeah, we love them tips
@jcc5018
@jcc5018 2 ай бұрын
your test tip reminded me of an issue i had with tests. Using sqlite, there seems to be an issue with database that have nullable foreign id fields. (integrity violations) Such as a parent child tag relationship. Works fine with the mysql database, but not with sqlite, and its preventing me from running any tests. Have you dealt with this or know how to fix? I had a hard time finding info online.
@LaravelDaily
@LaravelDaily 2 ай бұрын
Hasn't it been changed in last versions of Laravel/SQLite?
@jcc5018
@jcc5018 2 ай бұрын
@@LaravelDaily dont know, my laravel version is 11.27.2, sqlite3 is 3.19.1 I tried updating but the .dll files dont really match what is in the extension directory for php. so not sure if they need to installed somewhere else or not. Had a hard time finding windows install instructions.
@JaiveersinhChavda
@JaiveersinhChavda 2 ай бұрын
@@jcc5018 hey, have you checked , your local system is having sqlite3 enabled.
@sergeypashkevich574
@sergeypashkevich574 2 ай бұрын
User::all(['name', 'email']); - is shorter )
18 Laravel/PHP Tips in 10 Minutes: June 2024
10:41
Laravel Daily
Рет қаралды 10 М.
Top 5 Laravel "Bad Practices" (My Opinion)
10:32
Laravel Daily
Рет қаралды 24 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Writing Pest Tests for Laravel CRUD: Live-Coding
18:55
Laravel Daily
Рет қаралды 6 М.
New in Laravel 11: Concurrency
9:35
Codecourse
Рет қаралды 11 М.
Factory Design Pattern in Laravel Explained with a Project
36:25
ChatGPT for Laravel Devs: 9 Use-Cases You May Not Think About
9:44
Laravel + Livewire todo app (and so much more)
16:41
Aaron Francis
Рет қаралды 52 М.
So I've Analyzed 100+ Laravel Open-Source Projects...
11:40
Laravel Daily
Рет қаралды 6 М.
13 Laravel Tips in 10 Minutes: October 2024
10:14
Laravel Daily
Рет қаралды 6 М.
5 tips for supercharged Laravel Eloquent queries
16:29
Andrew Schmelyun
Рет қаралды 68 М.
API Platform for Laravel: My First Impression
12:39
Laravel Daily
Рет қаралды 10 М.
Why Don't We Have A Laravel For JavaScript?
12:36
Theo - t3․gg
Рет қаралды 112 М.