R
R
Roman Volkov2016-02-12 14:45:12
Laravel
Roman Volkov, 2016-02-12 14:45:12

How to generate URL in laravel using Laravel Localization?

The problem is that I use Laravel Localization and the urls are generated site.com/en/route
The problem is that when I try to call the route('news.index') construct, I get a message that the 'news' constant is not set
Route::resource('news', 'NewsController' );
route('news.index' );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrzej Wielski, 2016-02-12
@wielski

Are you sure you gave the route the correct name?

Route::get('/route', ['as' => 'news.index', 'uses' => '[email protected]', 'middleware' => ['web']]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question