Summer sale! Save 50% on access to our entire library of courses.Join here →

Articles

Showing 10 posts
July 19th, 2024

Logging Users Out of Other Browser Sessions with Laravel

Laravel provides a method for logging users out of all other browser sessions by re-hashing passwords. Let's look at how to use it to invalidate all other browser sessions for your users.

Author
Alex Garrett-Smith
Laravel
July 18th, 2024

Match Wildcard Routes in Laravel

Here's a quick tip on matching wildcard routes in Laravel. Once you're done, you can access the wildcard value and do anything you need to do with it.

Author
Alex Garrett-Smith
Laravel
July 17th, 2024

Easily Add Breadcrumbs to your Laravel Websites

Adding breadcrumbs to your Laravel sites has quite a few benefits. Let's look at the easiest way to add breadcrumbs in Laravel, and a few tips on customising them.

Author
Alex Garrett-Smith
Laravel
July 15th, 2024

How to get the next and previous records in Laravel

Laravel doesn't have built-in support to fetch next and previous records, but adding a couple of helper methods to your model does the trick.

Author
Alex Garrett-Smith
Eloquent
Laravel
July 12th, 2024

How to fix toOthers when broadcasting with a Laravel API request

The toOthers method won't work correctly if you're triggering a broadcast via an API request to your Laravel application. Here's why and how to fix it.

Author
Alex Garrett-Smith
Laravel
July 11th, 2024

How to Use orderBy() (and more) for Sorting Eloquent Query Results

Ordering in Laravel is pretty straightforward, but you can use a few other techniques to make the most of Eloquent's ordering abilities. Let's cover everything you should know about ordering queries with Laravel!

Author
Alex Garrett-Smith
Eloquent
Laravel
July 10th, 2024

Deploying Reverb on Laravel Forge

This guide covers every step you need to take to get Reverb up and running in production using Laravel Forge.

Author
Alex Garrett-Smith
Laravel
Server
July 10th, 2024

Seed Laravel factory data with an incrementing date

I often find myself seeding huge lists of data in Laravel that need to be ordered. Using sequences in factories, we can create a more realistic list of data by incrementing the created_at date.

Author
Alex Garrett-Smith
Laravel
July 9th, 2024

Sending a CSRF token when making fetch requests with Laravel

If you're making HTTP requests with JavaScript's Fetch API to web routes in Laravel, you'll need to pass a CSRF token rather than just exclude those routes from CSRF protection.

Author
Alex Garrett-Smith
Inertia
JavaScript
Laravel
Alpine.js
July 7th, 2024

Stop Laravel's HTTP Client from Following Redirects

By default, Laravel's HTTP client follows redirects. You can turn this off for individual requests or globally. Here's how.

Author
Alex Garrett-Smith
Laravel

Tags