Download the PHP package laravelba/route-binder without Composer

On this page you can find all versions of the php package laravelba/route-binder. 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 route-binder

Route Binder

Laravel route binding, done right.

Build Status

Laravel 4 or 5?

The master branch holds code compatible with Laravel 5. Releases for Laravel 5 start from the 3.0 tag.

For the Laravel 4 compatible release, go to the laravel4 branch.

The problem

Projects start simple: a few routes, maybe some resource controllers, and maybe some parameter binding here and there. But soon, the routes.php file starts to pile up, spawning hundreds of lines, with complex nested groups and filters or even (god forbid) having calls to App::make. Even more cumbersome, having to scroll all those lines searching for that odd route name that you clearly forget because, who remembers those anyway?

This package helps you with (at least) three things:

  1. It makes your routes part of your Application by letting you use DI through the IoC container
  2. It lets you split up routes in multiple files (classes) without the need for old-fashioned includes or requires
  3. As you'll be creating classes, you have an opportunity to declare some string constants and hold references to those nasty route names

The solution

This package is just two contracts, a config file and a ServiceProvider.

As usual, include the ServiceProvider in your config/app.php file like so:

Then, publish the package's configuration:

Afterwards, you'll need to create some classes that implement either the LaravelBA\RouteBinder\Routes interface, the LaravelBA\RouteBinder\Bindings interface or both. Don't panic! You'll see it's a piece of cake:

And add them to the published config file (you find it now in config/routes.php):

And you're done! Now all your routes are nicely organized, and if things get out of hand, you can always split 'em up more!

The IoC Container

I love Laravel's Route model binding functionality. I must confess though, I don't use Eloquent, so I always go for the Route::bind() option.

But this feature, as powerful as it may be, is pretty nasty on your architecture. Having calls to the DB on the routes.php file is awful, and going App::make(SomeRepository::class) does not look that much better either.

With this little package, your Bindings objects can depend on any Service or Repository layer of your application. Now, you could even test those bindings by mocking the dependencies and expecting a call to whatever Repository::find() method you use on route resolution!

This may look like waaaaaay too complicated a scenario right now, but trust me, you'll love it.


All versions of route-binder with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5.0
illuminate/contracts Version ~5.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 laravelba/route-binder contains the following files

Loading the files please wait ....