Jasmel Pc
Jasmel Pc

Reputation: 535

Can i return to a view from href tag in laravel without using controller?

I have a page home.blade.php.there is an href tag in this page which redirect to another page login.blade.php.

<a href="{{URL::to('login')}}">Login</a>.Any simple method to return to that page directly from this href tag?

Upvotes: 3

Views: 6172

Answers (1)

vipul sorathiya
vipul sorathiya

Reputation: 1316

Try this:

You can redirect at any blade template via Route::get, without using a controller.

In routes web.php

Route::get('/login', function(){
    return view('login'); // Your Blade template name
});

Upvotes: 4

Related Questions