Skip to content

Allow registration of catch-all routes on a resource #327

@lucianholt97

Description

@lucianholt97

I would like to use a 'catch-all' route for actions. The problem is, that queries for relationships are then routed to the action route instead of checking them first.
Would it be possible for you to change the sequence of the routes, so that relationship routes come first?

$api
            ->resource('orders', [
                'except' => ['create'],
                'has-one' => ['customer'],
            ])
            ->controller('Api\OrdersController')
            ->routes(function ($order) {
                $order->get('{record}/{action}', 'performAction');
            });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions