joedixon / laravel-translation

Translation management for your Laravel application.
MIT License
706 stars 233 forks source link

Error during installation in Laravel 8 #132

Open alexaderramos opened 3 years ago

alexaderramos commented 3 years ago

During installation the following problem occurred

`.... Generating optimized autoload files

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

Error

Unsupported operand types

at vendor/joedixon/laravel-translation/routes/web.php:3 1▕ <?php 2▕ ➜ 3▕ Route::group(config('translation.route_group_config') + ['namespace' => 'JoeDixon\Translation\Http\Controllers'], function ($router) { 4▕ $router->get(config('translation.ui_url'), 'LanguageController@index') 5▕ ->name('languages.index'); 6▕ 7▕ $router->get(config('translation.ui_url').'/create', 'LanguageController@create') 8▕ ->name('languages.create'); 9▕

  +10 vendor frames 

11 [internal]:0 Illuminate\Foundation\Application::Illuminate\Foundation{closure}()

  +5 vendor frames 

17 artisan:37 Illuminate\Foundation\Console\Kernel::handle() Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

`

janakparmar9491 commented 3 years ago

Same issue can somebody help?

kbs1 commented 3 years ago

@alexaderramos @janakparmar9491 This package installs cleanly in fresh Laravel 8. If you've recently upgraded to Laravel 8, first remove the package using composer remove joedixon/laravel-translation, then run php artisan optimize:clear.

After this, the package installed successfully for me.

Abdelrahman-Hazem commented 1 year ago

in vendor\joedixon\laravel-translation\routes Add : use Illuminate\Support\Facades\Route; then run :composer require joedixon/laravel-translation