2017 © Pedro Peláez
 

library laravel-param-converter

Symfony param converters working in Laravel.

image

pm-connect/laravel-param-converter

Symfony param converters working in Laravel.

  • Tuesday, December 12, 2017
  • by jralph
  • Repository
  • 3 Watchers
  • 1 Stars
  • 1,431 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 40 % Grown

The README.md

Laravel Param Converter

Gets the Symfony @ParamConverter annotation working within Laravel 5.3+., (*1)

Installation

Install using composer., (*2)

composer require pm-connect/laravel-param-converter

Setup

Setup is extremely simple, just add the service provider to your app.php config., (*3)

\PmConnect\LaravelParamConverter\ServiceProvider::class,

You can also publish the config so you can add your own param converters., (*4)

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., (*5)

This can be done by adding the following into a boot method of a service provider., (*6)

AnnotationRegistry::registerLoader('class_exists');

Custom Converters

See the Symfony docs for how to create custom converters here., (*7)

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., (*8)

The Versions