Download the PHP package sebastiaanluca/laravel-router without Composer

On this page you can find all versions of the php package sebastiaanluca/laravel-router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-router

Laravel Router

Latest stable release Build status Total downloads Total stars

Read my blog View my other packages and projects Follow @sebastiaanluca on Twitter Share this package on Twitter

An organized approach to handling routes in Laravel.

This package provides you with an easy-to-use system to separate route logic into routers based on functionality while also providing additional functionality. A replacement for those bulky web.php and api.php route files that are often lacking any structure and break Laravel structure conventions of separating everything in classes instead of regular PHP files.

Do note that it changes nothing to the way you define your routes. It's just a way of organizing them. Optionally you can use the additional functionality it provides, but that's not a requirement.

Table of contents

Requirements

Looking for support for earlier versions? Try out any of the previous package versions.

How to install

Just add the package to your project using Composer and Laravel will auto-discover it:

Further optional setup

If you want to be able to register your routers in a single place, add the RegistersRouters trait to your HTTP kernel (found at App\Http\Kernel):

How to use

Creating a router

The following is an example of a router. It can be placed anywhere you like, though I'd suggest grouping them in the App\Http\Routers directory.

The map method is where you should define your routes and is the only requirement when using a router. The Laravel routing instance is automatically resolved from the IoC container, so you can use any standard routing functionality you want. Of course you can also use the Route facade.

Registering the router

To automatically have the framework load your router and map its routes, add the trait and add the router to the $routers array in your application's HTTP kernel class:

Manually registering the router

If you don't want to or can't add the trait to the kernel, you can also register the router manually by just instantiating it (in a service provider for instance). The parent base router will automatically resolve all dependencies and call the map method on your router.

Especially useful in packages!

Optional features

To use the following optional features, register the RegisterRoutePatterns class:

Common route parameter patterns

Laravel provides a convenient way to validate URL parameters using patterns in routes. This package provides a predefined set of such patterns so you don't have to repeatedly add them to each route or define them yourself. The following parameter patterns are currently included:

So forget about writing:

Just use the {uuid} or any other pattern in your route:

Full-domain routing

Another great feature of Laravel is sub-domain routing which allows you to handle multiple subdomains within a single Laravel project. The only caveat there is that it only does that and doesn't handle full domains.

Laravel Router fixes that for you so you can direct multiple domains to a single Laravel project and handle them all at once. Simply define a route group with the {domain} pattern and use it in your callback or controller:

License

This package operates under the MIT License (MIT). Please see LICENSE for more information.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

About

My name is Sebastiaan and I'm a freelance Laravel developer specializing in building custom Laravel applications. Check out my portfolio for more information, my blog for the latest tips and tricks, and my other packages to kick-start your next project.

Have a project that could use some guidance? Send me an e-mail at [email protected]!


All versions of laravel-router with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
laravel/framework Version ^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sebastiaanluca/laravel-router contains the following files

Loading the files please wait ....