Skip to content

Improve apiRoute method, including a new only() method #150

@cbj4074

Description

@cbj4074

Sometimes, it's more useful to specify which API methods we do want, vs. those we don't.

For example this is what's required currently to have only a show method:

$this->apiRoute('featured', 'FeaturedController')
    ->except(['index', 'store', 'update', 'destroy'])
    ->addDefaultRoutes();

This would be much cleaner:

$this->apiRoute('featured', 'FeaturedController')
    ->only(['show'])
    ->addDefaultRoutes();

Also, make any other improvements/adjustments, as necessary, based on experiences thus far.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions