robertogallea / laravel-codicefiscale

Codice fiscale validation for php/laravel
MIT License
42 stars 16 forks source link

install failed #4

Closed manuel-84 closed 4 years ago

manuel-84 commented 4 years ago

Installation fails on laravel 6.x. This is the log:

composer require robertogallea/laravel-codicefiscale Using version ^1.2 for robertogallea/laravel-codicefiscale ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals

  • Installing robertogallea/laravel-codicefiscale (1.2.1): Downloading (100%) Writing lock file Generating optimized autoload files

    Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi

    Symfony\Component\Debug\Exception\FatalThrowableError : Class name must be a valid object or a string

    at \build\vendor\robertogallea\laravel-codicefiscale\src\CodiceFiscaleServiceProvider.php:33 29| public function register() 30| { 31| $this->app->singleton(CodiceFiscale::class, function (Container $app) { 32| return new CodiceFiscale(

    33| new $app['config']['codicefiscale.city-decoder']() 34| ); 35| }); 36| } 37|

    Exception trace:

    1 robertogallea\LaravelCodiceFiscale\CodiceFiscaleServiceProvider::robertogallea\LaravelCodiceFiscale{closure}(Object(Illuminate\Foundation\Application), []) \build\vendor\laravel\framework\src\Illuminate\Container\Container.php:800

    2 Illuminate\Container\Container::build(Object(Closure)) \build\vendor\laravel\framework\src\Illuminate\Container\Container.php:682

    Please use the argument -v to see more details. Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json to its original content.

robertogallea commented 4 years ago

Please check v1.3.0

DoctorAlfred commented 3 years ago

On Laravel 8 the problem is identical, with robertogallea / laravel-Codicefiscale version 1.4.1

robertogallea commented 3 years ago

Hi, @DoctorAlfred are you sure? I just tried with a fresh L8 install and it goes smooth.

DoctorAlfred commented 3 years ago

Sorry I forgot to omit that I use PHP v8! On PHP 8 it doesn't work ...

robertogallea commented 3 years ago

I use PHP 8 too, the composer dependency is

    "require": {
        "php": ">=7.1",
    }

so any version equal to 7.1 or above should work. What's the composer output?

DoctorAlfred commented 3 years ago

The same indicated in the first post !!!

DoctorAlfred commented 3 years ago

at D:\Source\Repos\homelyfe\vendor\robertogallea\laravel-codicefiscale\src\CodiceFiscaleServiceProvider.php:34 30▕ $this->app->singleton(CodiceFiscale::class, function () { 31▕ $decoder = config('codicefiscale.city-decoder'); 32▕ 33▕ return new CodiceFiscale( ➜ 34▕ new $decoder() 35▕ ); 36▕ }); 37▕ } 38▕

1 D:\Source\Repos\homelyfe\vendor\laravel\framework\src\Illuminate\Container\Container.php:826 robertogallea\LaravelCodiceFiscale\CodiceFiscaleServiceProvider::robertogallea\LaravelCodiceFiscale{closure}(Object(Illuminate\Foundation\Application), [])

2 D:\Source\Repos\homelyfe\vendor\laravel\framework\src\Illuminate\Container\Container.php:712 Illuminate\Container\Container::build(Object(Closure))

robertogallea commented 3 years ago

I am sorry, I can't reproduce your issue.