Tutorials for Developers & Sysadmins

Step-by-step guides for the work we actually do — Laravel, PHP, WordPress, MySQL, Linux servers, and the occasional rabbit hole. Every command has been run on a real machine; nothing is theoretical.

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

How to Delete Related Records in Laravel Eloquent

Delete related rows automatically in Laravel with database-level cascade constraints or Eloquent's deleting event. Compare the two approaches plus SoftDeletes…

how7o

How to Change a MySQL Column Type in Laravel Migration

Change a MySQL column type in Laravel using the change() method. Covers Laravel 10+ native support, doctrine/dbal for older versions,…

how7o

How to Add New Columns to an Existing Table in Laravel Migration

Add new columns to an existing Laravel table with a migration. Covers nullable defaults, column position, dropColumn, and reversible down()…

how7o

How to Add Foreign Keys in Laravel Migration

Add foreign keys in Laravel migrations using foreignId and constrained. Learn cascadeOnDelete, dropForeign, and the explicit long-form syntax.

how7o

How to Use the Laravel Validator Exists Rule

Learn how to validate a database reference with Laravel's exists validation rule. Use table, model, and fluent Rule::exists() forms plus…

how7o

How to Check if a Record Exists in Laravel

Learn four idiomatic ways to check if a record exists in Laravel: exists(), doesntExist(), count(), first(), and firstOrFail(). Pick the…

how7o

Laravel updateOrCreate: Insert or Update Records in Eloquent

Laravel updateOrCreate inserts or updates a record in one call. Learn when to use updateOrCreate, firstOrNew, upsert, and updateOrInsert in…

how7o

How to Upgrade the Linux Kernel in CentOS 7

Learn how to upgrade the Linux kernel in CentOS 7 using ELRepo. Step-by-step guide covering kernel installation, GRUB configuration, and…

how7o