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
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.