Reader Stacks

TOPIC

Authentication & Access Control

Middleware, guards, and gating access to routes and resources.

What Is Laravel Middleware?

Middleware runs between a request arriving and a controller handling it — the mechanism behind auth checks, CORS headers, and rate limiting, all inspecting or modifying the request/response without the controller knowing.

Working With Sessions in Laravel

Beyond auth (which uses sessions internally), the Session facade is the standard place for anything that needs to persist briefly across requests for one visitor — flash messages, a multi-step form's in-progress data, a shopping cart.

Implementing "Remember Me" Login in Laravel

Laravel's "remember me" is a single boolean argument to Auth::attempt — the useful part to actually understand is the long-lived cookie and remember_token column behind it.

Connecting PHP to MySQL With PDO

PDO is the modern, framework-agnostic way to talk to MySQL from plain PHP — and prepared statements aren't optional if user input touches the query.

Password Hashing and Verification in Laravel

The Hash facade, why bcrypt/argon2 hashes look different every time for the same password, and the correct way to verify a login without ever decrypting anything.