felixkiss / uniquewith-validator

Custom Laravel Validator for combined unique indexes
MIT License
389 stars 129 forks source link

Fix deprecated function #111

Closed stefanullrich closed 5 years ago

stefanullrich commented 5 years ago

use get instead of trans, which is deprecated in Laravel 6 (see https://laravel.com/docs/6.0/upgrade#trans-and-trans-choice get was already available in Laravel 5, so it will work, too.

stefanullrich commented 5 years ago

@EmilMoe Ok, done.

stefanullrich commented 5 years ago

@felixkiss the current release 3.3.0 is not working with Laravel 6:

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

   BadMethodCallException  : Method Illuminate\Translation\Translator::trans does not exist.

  at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php:104
    100|      */
    101|     public function __call($method, $parameters)
    102|     {
    103|         if (! static::hasMacro($method)) {
  > 104|             throw new BadMethodCallException(sprintf(
    105|                 'Method %s::%s does not exist.', static::class, $method
    106|             ));
    107|         }
    108|

  Exception trace:

  1   Illuminate\Translation\Translator::__call("trans")
      /var/www/html/vendor/felixkiss/uniquewith-validator/src/Felixkiss/UniqueWithValidator/ServiceProvider.php:19

  2   Felixkiss\UniqueWithValidator\ServiceProvider::boot()
      /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32

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

This pull request solves it and it would be great, if you can create a new release. I don't want to rush, but maybe others have the same problem. Thx

felixkiss commented 5 years ago

Thanks! Released as 3.3.1

stefanullrich commented 5 years ago

Perfect!!! Thx