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

How to initiate this package? #51

Closed Heqma closed 3 years ago

Heqma commented 3 years ago

" 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');
chinleung commented 3 years ago

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 3 years ago

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

chinleung commented 3 years ago

@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 https://github.com/chinleung/laravel-multilingual-routes/issues/50.

Heqma commented 3 years ago

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

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

chinleung commented 3 years ago

@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 3 years ago

image

image image image