honda / url-resolver
Resolve routes and urls with one function.
Installs: 2 601
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
Requires
- php: ^8
- illuminate/contracts: ^8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- orchestra/testbench: ^6.13
- pestphp/pest: ^1.0.5
- phpstan/phpstan: ^1
- symfony/var-dumper: ^5.2.0
This package is auto-updated.
Last update: 2024-07-10 04:12:52 UTC
README
Url Resolver for Laravel
Resolve routes and urls with one function.
Installation
Requires PHP 8.0+
You can install the package via composer:
composer require felixdorn/laravel-url-resolver
Usage
use Honda\UrlResolver\UrlResolver; UrlResolver::guess('welcome', []);
- The route exists:
route('...', $context)
- The route does not exist:
url(...')
- The "route" is an external URL: returns it
Testing
Runs the entire test suite:
composer test
Runs PHP CS Fixer:
composer lint
Runs PHPStan:
composer test:types
Runs unit tests
composer test:unit
Url Resolver for Laravel was created by Félix Dorn under the MIT License