In Laravel, I am trying to accomplish the ability to have a variable quantity of categories in a URL, followed by the slug. For example:

www.trashaccount.com/category1/category2/slug

I am using a route pattern in Laravel to identify the categories

```
Route::pattern('cat', '([-a-zA-Z0-9]+\/?)*');

```

and the demo/test route looks like this:

```
Route::get('test/{cat}/{slug}', function($cat, $slug) {
    $categories = explode('/', $cat);
    $i = 1;
    foreach($categories as $category)  {
        echo "category " . $i . ": " . $category . "<br>";
        $i++;
    }
    echo "slug: " . $slug . "<br>";
});

```

This can be tested at www.trashaccount.com/test/{cat}/.../{slug}

This code successfully pulls out a variable number of categories, of any character length; for example this works:

<http://www.trashaccount.com/test/cat1/cat2/cat3/abcdefghijklmnopqrstuvwxyzabcdevg/my-slug>

Where it breaks, is in the number of characters of the final element, the {slug}. For some reason anything beyond 17 characters throws a NotFoundHttpException. So, this does not work:

<http://www.trashaccount.com/test/cat1/abcdefghijklmnopqr>

But if you simply delete the "r" (the 18h character), it works.

To clarify (as my post was being misinterpreted on another forum), you can type as many categories as you want, they can be any length (respecting HTTP limits), and they will be accepted and processed. The final element that I have labeled as {slug}, can not be longer than 17 characters without throwing a NotFoundHttpException error.

Does anybody know what I am doing wrong?

Thanks!