Skip to content

ExportPaths

Choose a tag to compare

@anthonyholmes anthonyholmes released this 27 Jul 02:56
· 13 commits to main since this release

Define export paths to route controller methods that have parameters

Pass a Class or array directly to the attribute

use Capo\Attributes\ExportPaths;

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

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