prodemmi / route-genius
This package provides defining routes in controller.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=8.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-15 21:01:01 UTC
README
Installation
composer require prodemmi/route-genius
Usage
Route Genius is a package for defining your routes in controllers.
<?php namespace App\Http\Controllers\V1; use Illuminate\Routing\Controller as BaseController; use Prodemmi\RouteGenius\Registradores\Middleware; use Prodemmi\RouteGenius\Registradores\Name; use Prodemmi\RouteGenius\Registradores\Prefix; use Prodemmi\RouteGenius\Registradores\WhereUlid; use Prodemmi\RouteGenius\Registradores\WithoutMiddleware; use Prodemmi\RouteGenius\Routes\Get; use Prodemmi\RouteGenius\Routes\Post; #[Middleware( 'api' ), Prefix( 'api/v1' )] class AppController extends BaseController { #[Get( '/' )] public function index() { return 'index'; } #[Get( '/{uuid}' ), WithoutMiddleware( 'api' )] public function single($uuid) { return $uuid; } #[Get( '/categories/{category}' ), WhereUlid( 'category' )] public function categories($category) { return $category; } #[Post( '/' ), Name( 'store' )] public function store() { return "Store"; } }