chinleung / laravel-multilingual-routes

A package to handle multilingual routes in your Laravel application.
https://github.com/chinleung/laravel-multilingual-routes-demo
MIT License
394 stars 26 forks source link

Crash with undefined offset after upgrading to Laravel 8 #43

Closed da40 closed 3 years ago

da40 commented 3 years ago

Describe the bug

Routes which directly display a view cause a crash at vendor\laravel\framework\src\Illuminate\Routing\ViewController.php:35, as seen in the attached trace back. laravel.log

To Reproduce

Steps to reproduce the behavior:

  1. Create a new Laravel 8 app.
  2. Install laravel-multilingual-routes.
  3. Create app/locales.php with 'supported' => [ 'en', 'fr' ].
  4. In routes/web.php, add Route::multilingual('home')->view('welcome');
  5. Start PHP web browser in the public directory.
  6. Enter "http://localhost:8000/home" in web browser,

Expected behavior

The welcome page should have been displayed.

Result of route:list:

Please post the result of php artisan route:list here with the concerned routes.

+--------+----------+----------+---------+----------------------------------------------+------------+ | Domain | Method | URI | Name | Action | Middleware | +--------+----------+----------+---------+----------------------------------------------+------------+ | | GET|HEAD | / | | Closure | web | | | GET|HEAD | api/user | | Closure | api | | | | | | | auth:api | | | GET|HEAD | fr/home | fr.home | Illuminate\Routing\ViewController | web | | | GET|HEAD | home | en.home | Illuminate\Routing\ViewController | web | +--------+----------+----------+---------+----------------------------------------------+------------+

Additional context

Add any other context about the problem here.

chinleung commented 3 years ago

Hi @DA40,

The fix is available as of v2.7.2.