ryanj's avatar
Level 1

How to go directly to view with URL?

I thought before I was always able to go to mylaravelappname.test/viewname and load the view but now it seems like I cannot do that. I have tried relinking using Valet Link. For example, if my app is called "login" and I have a view called "about" shouldn't I be able to go to login.test/about and load the about view? Maybe this was never possible and I am wrong

0 likes
3 replies
jlrdw's avatar

Do you have your routes set up correctly in the web folder.

burlresearch's avatar
Level 40

You need a route to forward the request. This would normally be defined in route/web.php (it used to be just called route.php but you always needed to define the route somewhere).

Since 5.5 there has a been a handy little route shortcut to directly invoke a view-blade file from the route definition: Route::view('/about', 'about');

which would forward to the view about.blade.php - if this is what you are looking to do.

1 like

Please or to participate in this conversation.