Reader Stacks

GUIDES

Laravel — Page 8

Laravel tutorials, Eloquent, artisan, auth, APIs, and deployment.

How to Share Variables Across All Views in Laravel

View::share() makes a variable available to every view without passing it explicitly from each controller — the right tool for genuinely global data like site settings or unread notification counts.

Hashing and Verifying Passwords in Laravel

Hash::check() never decrypts the stored hash to compare it — bcrypt is one-way by design, so verification works by re-hashing the input and comparing the two hashes instead.

Creating a Custom 404 Error Page in Laravel

Laravel already looks for resources/views/errors/404.blade.php automatically — no route or controller registration needed, just the right file in the right place.

Conditional Validation Rules in Laravel

requiredIf, requiredUnless, sometimes, and a full closure-based rule all handle a field that should only be validated under a specific condition.

Creating a Custom Helper Class in Laravel

A plain PHP class for app-specific logic that doesn't belong in a model or controller — with a class alias so it's callable without a full namespace, and when a facade is worth the extra step instead.

Validating Array Input in Laravel

The dot-notation syntax for validating each item in an array field, and the * wildcard for a variable-length list — like a form that lets someone add multiple items dynamically.