tobytwigger / laravel-translate

Supercharged instant translations for any Laravel project.
https://tobytwigger.github.io/laravel-translate
MIT License
6 stars 9 forks source link

Required parameter $container follows optional parameter $config #29

Closed sheinfeld closed 2 years ago

sheinfeld commented 3 years ago

Hey guys,

So, here is the situation: I'm using this package alongside AWS to translate articles into multiple languages.

For some reason, when I reach de (German) I get the following error:

[33] Required parameter $container follows optional parameter $config /vendor/twigger/laravel-translate/src/Translate/Handlers/AWSTranslator.php

Has anyone encountered this error or has any idea on how to fix it?

Thanks in advance!

tobytwigger commented 3 years ago

Hey @sheinfeld. Thanks a lot for opening an issue, I'm really glad you like the package and are able to make use of it!

PHP 8 (rightfully) made putting optional parameters before required ones an error, fortunately it's pretty easy to fix! I should be able to get round to this tomorrow and put out a new release with this issue fixed and officially supporting php 8 - if you need it sooner than that I'd be very open to you opening a PR! :smile:

sheinfeld commented 3 years ago

Thank you man <3

tobytwigger commented 3 years ago

Hey @sheinfeld! I've just made the change and opened PR #30 , would you be able to see if that solves your problem? If so I'll release it properly for you.

You can change your composer.json file to require "twigger/laravel-translate": "dev-parameter-order" and run composer update to ensure it works for you!