Skip to content

ExportPaths Attribute

Choose a tag to compare

@anthonyholmes anthonyholmes released this 07 Jun 00:14
· 14 commits to main since this release

Define export paths to route controller methods that have parameters

use Capo\Attributes\ExportPaths;

class SomeController
{
    #[ExportPaths(SomeClassWithPathsMethod::class)]
    public function show(string $name)
    {}
}

class SomeClassWithPathsMethod
{
    public function paths(): array
    {
        return [
            'path1',
            'path2',
        ];
    }
}