Тёмный

Multi-Join Raw SQL Query To Laravel Query Builder Conversion 

Laratips
Подписаться 18 тыс.
Просмотров 6 тыс.
50% 1

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 9   
@Laratips
@Laratips Год назад
GET ONE MONTH OF FREE HOSTING Get $15 credit by using code "LARATIPS" which can last almost a month. Cloudways Web Hosting: platform.cloudways.com/signup?id=1029148&data1=bw&coupon=LARATIPS Cloudways offers peace of mind and flexibility so you can focus on growing your business and reaching new milestones instead of dealing with server management. With Cloudways, you get an optimized stack, managed servers, backups, staging environment, integrated Git, pre-configured, Composer, 24/7 support, and the choice of five cloud providers: AWS, DigitalOcean, Linode, Google Cloud, and Vultr
@julienSibille
@julienSibille Год назад
Wow so useful, thanks !
@Laratips
@Laratips Год назад
Nice to hear that 😀
@issaissifou4959
@issaissifou4959 Год назад
thank you so much!
@mediacreations2827
@mediacreations2827 Год назад
Thanks for the tips. I have an UPDATE query that I'm struggling with, hope you can solve this. I have a "users" table with a column "address" where a string value is added. To make things cleaner I created a separate table "locations" to store all the addresses and set up foreignId('location_id') on the "users" table. "locations" table is then filled by getting unique "address" values from "users" table. Now I need to update the "location_id" of existing users. This is what I tried: $locations = Location::get(); // only about 100 results are there User::query() ->whereNotNull('address') ->update([ 'location_id' => $locations->firstWhere('street', DB::raw('address'))->id ]); For some reason, the above query is not updating the column.
@adam192021
@adam192021 Год назад
should you use "with('roles')" instead of "join"?
@Laratips
@Laratips Год назад
If you do that, you will not be able to sort by roles name
@jeetjeet4585
@jeetjeet4585 Год назад
Which theme and extension are using in VS code ?
@Laratips
@Laratips Год назад
In the description
Далее
Multiple Aggregates In One Query In Laravel
1:34
Просмотров 4,1 тыс.
Аушев, Путин, «пощечина»
00:56
Просмотров 574 тыс.
Laravel Security: Top 7 Mistakes Developers Make
11:16
Laravel 8 Tutorial | Query Builder Join Table Part 24
6:52
Snowflake Query Optimization
35:04
Просмотров 8 тыс.
Query Builder | Laravel For Beginners | Learn Laravel
17:09
Faster Eloquent: Avoid Accessors with Foreach
9:35
Просмотров 53 тыс.
6 SQL Joins you MUST know! (Animated + Practice)
9:47
Просмотров 153 тыс.
5 tips for supercharged Laravel Eloquent queries
16:29