dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.33k stars 1.25k forks source link

Add Route::patterns() while app is beeing bootstrapped and not after #1694

Closed christoph-kluge closed 4 years ago

christoph-kluge commented 4 years ago

In my concrete scenario I was not able to separate my handlers based on the routes with different patterns. This PR allows us to handle it properly for the LaravelAdapter.

The following examples are working now properly:

$api->get('/entity/{uuid}', GetEntityByUuid::class)
$api->get('/entity/{slug}', GetEntityBySlug::class)
$api->get('/entity/{customIdentifier}', GetEntityByCustomIdentifier::class)
christoph-kluge commented 4 years ago

referencing pull-request #1619 and issue #1232

specialtactics commented 4 years ago

Hey @christoph-kluge

Thanks for the PR, I did some local testing against projecting using UUIDs, and it seems to be working.

I'll tag as minor.