Here’s a way to assess the performance of a query: Start tinker in the Laravel project directory php artisan tinker
Tag: Eloquent
Laravel Eloquent Collection Tips
Adding a column with constant value to existing collection: $existing_col->map(function ($col) { $col[‘url’] = ‘http://your.url/here’; return $col; }); To add
Laravel Query Builder
A good article on DB::RAW Some general examples RacingĀ condition: Breaking Laravel’s firstOrCreate using race conditions To solve this problem