Laravel power tools you’re probably not using (yet)

Last updated:

Reading time: 2 min

Laravel power tools you’re probably not using (yet)

Laravel ships with tons of elegant features but some of its most useful tools fly under the radar.

These lesser-known helpers can make your codebase cleaner, safer, and faster with almost no extra effort.

Let’s dive in.

Bulk inserts with model intelligence

Instead of plain insert(), try:

User::fillAndInsert([

  ['name' => 'Anna'],

  ['name' => 'Ben'],

]);

It respects timestamps, casts, UUIDs, and defaults perfect for imports and seeders.


Block compromised passwords

use Illuminate\Validation\Rules\Password;

$request->validate([

  'password' => ['required', Password::min(8)->uncompromised()],

]);

This rejects passwords found in known breaches an instant security win.


Cleaner many-to-many queries

Before:

Post::whereHas('tags', fn ($q) => $q->whereKey($tags))->get();

After:

Post::whereAttachedTo($tags)->get();

More readable, less nesting ideal for tag systems.


Auto-Load relationships

User::withRelationshipAutoloading();

$user = User::find(1);
No $with. No repeated with(). Fewer accidental N+1 queries.


Query pipelines

User::query()

  ->pipe(fn ($q) => $q->where('active', true))

  ->get();

Great for modular filters and dynamic search logic.


Reset ordering

$query->reorder()->get();

Wipes all orderBy() clauses handy for sortable tables and overrides.


Attach uploaded files to emails

Attachment::fromUploadedFile($file);

No temp storage. No extra steps. Cleaner mailables.


See raw SQL from exceptions

dump($e->getRawSql());

Instantly inspect the real query huge for debugging.


Wrap-Up

These tools help you write:

- Cleaner queries

- More secure auth

- Faster bulk ops

- Easier debugging

If one surprised you drop a comment.