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 ];
@alighanati54532 ай бұрын
thank you for this great tips, i liked conditionable and whereRelation, it's amazing there are multiple ways to do things
@yezperdk2 ай бұрын
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.
@SilverPaladin23 күн бұрын
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.
@SilverPaladin23 күн бұрын
With the User::select('id','name) you can also do Posts::with('user:id,name') to eager load specific related columns
@eyemazed2 ай бұрын
being able to override the random function return value with a predefined constant feels so wrong on so many levels
@mayanksgajjar2 ай бұрын
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
@nielskok29352 ай бұрын
@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
@LaravelDaily2 ай бұрын
Not sure, can't answer without debugging the specific scenario
@jonwinder18612 ай бұрын
working with YII 1 at the moment for work. Having laravel withdrawals everyday.
@JonnyJKF2 ай бұрын
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.
@yadindominguez10272 ай бұрын
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?
@LaravelDaily2 ай бұрын
It's a personal preference, either way is fine
@3733232 ай бұрын
yeah, we love them tips
@jcc50182 ай бұрын
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.
@LaravelDaily2 ай бұрын
Hasn't it been changed in last versions of Laravel/SQLite?
@jcc50182 ай бұрын
@@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.
@JaiveersinhChavda2 ай бұрын
@@jcc5018 hey, have you checked , your local system is having sqlite3 enabled.