Learn

How to Do a Left Outer Join in Laravel Query Builder

Perform a laravel left outer join with the query builder: basic syntax, closure conditions, leftJoinSub for subqueries, and when to…

how7o

How to Retrieve the Last Inserted ID in Laravel Eloquent

Get the laravel last inserted id the right way: read $model->id after save/create, use latest('id')->first(), or insertGetId(). Avoid the all()->last()…

how7o

How to Get Records Created Today in Laravel

Query laravel eloquent records today with whereDate + Carbon::today(), a Carbon-free variant, and an index-friendly whereBetween range for large tables.

how7o

How to Get Current Month Records in Laravel Eloquent

Query Laravel Eloquent current month records three ways: whereMonth+whereYear, Carbon, and the index-friendly whereBetween range. Includes timezone fix.

how7o

How to Count Records Grouped By a Column in Laravel Eloquent

Use laravel eloquent group by count with select + DB::raw, fix ONLY_FULL_GROUP_BY errors, and filter groups with havingRaw. Working examples…

how7o

How to Count Rows in Laravel Eloquent Efficiently

Learn how to laravel eloquent count rows efficiently: count(), withCount() for relationships, count(column) for NULLs, and distinct counts.

how7o

How to Delete a Record with Laravel Eloquent (4 Methods)

Four ways to laravel eloquent delete record: find-and-delete, destroy by key, mass where-delete, and forceDelete for soft-deleted rows with examples.

how7o

How to Combine Multiple where() and orWhere() in Laravel Eloquent

Fix laravel eloquent multiple where orwhere bugs with closure grouping. Learn precedence pitfalls, nested groups, and the Laravel 10.47+ whereAny…

how7o

How to Use orderBy in Laravel Eloquent (with Examples)

Master laravel eloquent order by: orderBy, orderByDesc, latest, multi-column sorts, random order, and custom local scopes with working examples.

how7o

How to Change a User Password in Laravel

Change a Laravel user password with artisan tinker, a temporary route, or a custom artisan command. Use Hash::make() so the…

how7o