P
P
Pavel Bykov2018-05-12 23:47:13
Laravel
Pavel Bykov, 2018-05-12 23:47:13

Why laravel doesn't see route name?

There is a route code like this

Route::group(["prefix" => "/admin", "as" => "admin-"], function() {
Route::get("/", ["as" => "main", "uses" => "[email protected]"]);
Route::view("/vv", "about", ["name" => "vv"]);
});

Route::get works with a bang, but the view does not want to assign a name in the group (it turns out that the name should be admin-vv), I already tried and assign the property as instead of the name property, and simply tried to register through the ->name() method this name, and nothing helped ....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Victor, 2018-05-13
@mafof

With this code, you do not set a name, but pass data to the template.
In theory, the ->name method should work.

Y
Yan-s, 2018-05-13
@Yan-s

https://laravel.com/api/5.5/Illuminate/Routing/Rout...
Type AND run the command to see if the route name is set
php artisan route:list

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question