chinleung/laravel-multilingual-routes

How to initiate this package?

Heqma opened this issue · 6 comments

Heqma commented

"
UnexpectedValueException
Invalid route action: [App\Http\Controllers\FrontController].

App\Http\Controllers\FrontController is not invokable.
The controller class App\Http\Controllers\FrontController is not invokable. Did you forget to add the __invoke method or is the controller's method missing in your routes file?"

controller

Route::redirect('/', locale());
Route::multilingual('/', 'FrontController')->name('index');

The controller class App\Http\Controllers\FrontController is not invokable. Did you forget to add the __invoke method or is the controller's method missing in your routes file?

@Heqma Can you show the contents of the FrontController please? Do you have an __invoke method?

Heqma commented

image
image
i dont know why my route group isnt work... i have 404.. with group routes.. i

@Heqma There's currently an issue with prefixes. I'll be working on this soon. For the moment, you can do it without the prefix method.

I'll be closing this since it's a duplicate of #50.

Heqma commented

Ok then... also i need to know why translate isn't work...
image
image

Facade\Ignition\Exceptions\ViewException Route [contact.store] not defined

@Heqma When you use the name method, it adds the locale prefix to the route's name. So it would either be pl.contact.store or en.contact.store. Or you can use the helper localized_route('contact.store').

You can view the list of your application's routes with php artisan route:list to confirm their names.

Heqma commented

image

image
image
image