Download the PHP package aidan-casey/laravel-route-binding without Composer
On this page you can find all versions of the php package aidan-casey/laravel-route-binding. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aidan-casey/laravel-route-binding
More information about aidan-casey/laravel-route-binding
Files in aidan-casey/laravel-route-binding
Package laravel-route-binding
Short Description Adds Laravel route binding for non-controller objects.
License MIT
Informations about the package laravel-route-binding
Laravel Route Binding
This package is heavily influenced by the default route binding available in Laravel. The primary difference being that this package extracts such functionality to a utility class that may be used throughout your application.
This package also resists utilizing the Laravel container to instantiate the object (though the Laravel container is used to resolve dependencies) so that this utility may be used in a Laravel service provider without causing a recursive dependency lookup.
Install
To install, run:
Usage
To build a class with route parameters and return an instance of it, us the static make
method. This method does accept an extra array of parameters if you wish to override any values.
To bind route parameters to a specific method of a class, use the static call
method. You may pass either an existing class instance or a class string to this method.
Performance
This package does make extensive use of reflection classes. It is recommended that you bind your result to the container so this only happens once. This can be done by using the beforeResolving
method in a Laravel service provider. For example:
All versions of laravel-route-binding with dependencies
illuminate/collections Version ^9.0
illuminate/routing Version ^9.0
illuminate/support Version ^9.0