DEStroyerll's avatar

Address bar problems

Guys, first problem! I created user authentication and I want to change the name of the link in the route

Auth::routes();

Route::get('/dashboard', 'HomeController@index')->name('dashboard');

Instead of / home, I specified /dashboar but this not working He writes that there is no such page !!! Second problem, I have a group of routes I created for the admin here it is

Route::group(['prefix'=>'admin', 'middleware'=>'auth'], function () {

    Route::get('/', ['uses'=>'Admin\IndexController@index']);

    //Маршрут для редактирования материала блога.
    Route::resource('/articles', 'Admin\ArticlesController');
});

But when I want to follow the links to this route to me

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Dashboard</div>

                <div class="panel-body">
                    @if (session('status'))
                        <div class="alert alert-success">
                            {{ session('status') }}
                        </div>
                    @endif

                    You are logged in! Now you can <a href="{{route('admin')}}">manage </a>content.
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

Again I get an error and say that there is no such view (( Brothers help !!! I already broke my head in conjectures.

0 likes
5 replies
realrandyallen's avatar

The route helper you're using accepts a route name, you've specified 'admin' so you need to change your route to this to add the admin name:

Route::get('/', ['uses'=>'Admin\IndexController@index'])->name('admin');
Cronix's avatar

What about my first problem?

You didn't show how you are trying to make the link with the dashboard route, you only showed the route definition. So how could we know what your mistake is? You just say "it's not working"

For your second problem, you don't have a route defined with the name of admin, so this doesn't work

<a href="{{route('admin')}}">manage </a>
DEStroyerll's avatar

@cronix I just want to change the path name from home to the dashboard, but I can't do it, the address bar still displays in the address bar

Snapey's avatar

in Auth LoginController check the value of $redirectTo

Please or to participate in this conversation.