Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ Once the pattern has been defined, it is automatically applied to all routes usi
// Only executed if {id} is numeric...
});

<a name="parameters-encoded-forward-slashes"></a>
#### Encoded Forward Slashes

By default, the Laravel routing component allows all characters except `/`. You must explicitly allow `/` to be part of your placeholder by specifying it with a `where` condition:

Route::get('search/{search}', function ($search) {
return $search;
})->where('search', '.*');

Now when you submit a search with an encoded forward slash, it'll be decoded in the `$search` parameter.

> {note} Please note that using encoded forward slashes is only possible for the last route segment.

<a name="named-routes"></a>
## Named Routes

Expand Down