pm-connect / laravel-param-converter
Symfony param converters working in Laravel.
Installs: 17 485
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 3
Open Issues: 0
Requires
- php: ~7|~8
- doctrine/annotations: ~1
- illuminate/config: 5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0
- illuminate/container: 5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0
- illuminate/http: 5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0
- illuminate/routing: 5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0
- illuminate/support: 5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x|^6.0|^7.0|^8.0
- laravel/helpers: ^1.0
- sensio/framework-extra-bundle: ~3.0|~4.0|~5.0
README
Gets the Symfony @ParamConverter
annotation working within Laravel 5.3+.
Installation
Install using composer.
composer require pm-connect/laravel-param-converter
Setup
Setup is extremely simple, just add the service provider to your app.php
config.
\PmConnect\LaravelParamConverter\ServiceProvider::class,
You can also publish the config so you can add your own param converters.
php artisan vendor:publish --provider="\PmConnect\LaravelParamConverter\ServiceProvider"
Annotation Registry Loader
Depending on the setup you have, you may need to setup doctrines AnnotationRegistry
class and tell it how to autoload classes.
This can be done by adding the following into a boot
method of a service provider.
AnnotationRegistry::registerLoader('class_exists');
Custom Converters
See the Symfony docs for how to create custom converters here.
Once created, just add the class to the param-converter.php
config file (as long as you have published your config!) and away you go.