Join 26,000+ Laravel Developers and join the free Laravel Newsletter

Routing

404 Responses in a Laravel API
Laravel Tutorials / August 16, 2018

404 Responses in a Laravel API

A useful feature that shipped in Laravel 5.5 is fallback routing that we can use to define a fallback 404 error. Mohamed Said has an excellent write-up on this feature and we’ll look closer at implementing a fallback route for an API. When you are creating an API, you probably want a fallback route that responds with JSON (or whatever format you are serving via content negotiation) instead of the default 404. We’ll look at how you can create a fallback route for your API, test it,... Read more…

Getting Started with Signed Routes in Laravel
Laravel Tutorials / March 21, 2018

Getting Started with Signed Routes in Laravel

Laravel includes the ability to create signed URLs and in this article, we’ll work on enabling signed URLs in an application and look at a few options of how to use them.

Read more…
Ziggy: A Package for Named Laravel Routes in JavaScript
Laravel Packages / August 10, 2017

Ziggy: A Package for Named Laravel Routes in JavaScript

Ziggy is a package that exposes named Laravel routes in JavaScript written by Caleb Porzio and Daniel Coulbourne from Tighten Co. Learn about Ziggy and how you can use it to keep your routes in sync between a Laravel backend and JavaScript.

Read more…
Route improvements are coming to Laravel 5.4
Laravel 5.4 / December 06, 2016

Route improvements are coming to Laravel 5.4

As Laravel 5.4 development continues two new improvements are coming to your routes, better route caching for large applications and fluently registering routes.

Read more…
Laravel Missing Page Redirector Package
Laravel Packages / November 04, 2016

Laravel Missing Page Redirector Package

If you moved your site to a new domain, chances are you want the users and search engines to be directed to the correct pages on the new domain. One way to do that is using 301 permanent redirects from old pages locations to the new pages locations. In Laravel you can define this in …

View your routes through the browser with the Pretty Routes package
Laravel Packages / September 19, 2016

View your routes through the browser with the Pretty Routes package

One nice Laravel feature is its routing, by visiting your routing file, you can get an eagle eye view of your application and a map that shows which URL is corresponding to which file. By default, Laravel provides a handy Artisan command php artisan route:list that can be used to list your routes in a …

Laravel Tutorials / February 20, 2016

How the Laravel Router is made

Matthew Machuga has started a new video series on Tuts+ and the first video is out on how the Laravel Router works: In this lesson, we’ll explore the intricacies of Laravel Router. We’ll talk about the fundamentals of HTTP routing, before we go on to analyze some of the decisions and nuances in the design …

Laravel Tutorials / June 30, 2015

Protecting Routes with Invoke

Chris Cornutt has a new tutorial showing how to implement the Invoke package with Laravel to restrict routes. For those not familiar with Invoke: The Invoke system helps you protect your application based on the endpoints and the URI requested. It uses a configuration file (or array of settings) to define the permissions needed to …

Laravel Packages / June 17, 2015

Customizable Paginated Routes

Out of the box, Laravel provides pagination but they are opinionated in how the url’s are generated. This pagination package allows you to customize the links by using translations and removes the query string parameter. For an example, here is what your new links can look like: http://example.com/news/page/2 Or fully translatable: http://example.com/nieuws/pagina/2 http://example.com/nachrichten/seite/2

Read more…
Laravel Tutorials / June 27, 2014

Laravel Routing Best Practices

A few days ago Laracasts released a routing best practices video: Let’s take some time to review a number of best practices, when it comes to how you structure your app’s routing layer. This video has a bunch of great tips. It also helped clarify the disagreement I started on Twitter when I said that …