Support the ongoing development of Laravel.io →
posted 2 years ago
API
Last updated by @nnngit 1 year ago.
0

Can you explain your question, possibly with an example of what you are actually trying to achieve?

0

how to use route::view in api.php to c blade view

Last updated by @nnngit 2 years ago.
0

laravel docs doesn't specify how to use view verb in 1 line in api.php routes.? i want is i want to use view route in api.php to view blade file

0

You can use it the same way as you do it in the web.php file. Here is the syntax

Route::view('/welcome', 'welcome');

The first argument is the URL and the second is the name of the blade file. Before accessing the URL make sure you prefix it with /api. Here is the link to the official documentation. View Routes

0

@faisal this view route is not working laravel8.83.5 y so, if i give get and funtion for view it is working

0

I checked the same on the Laravel Framework 8.83.6 and I was able to load the view from api.php file. Can you tell me the exact error that you are receiving while using Route::view() function in api.php

0

snippet line Route::view('welcome', 'welcome');

1st welcome is postman url router verb view 2nd welcome is welcome.blade.php

by route get i can achieve i want by view only

0

I did the same and I received the view inside the postman as well.

0

no err ,not responding any @faisal any config is there to use view verb in route ~>api.php

Last updated by @nnngit 2 years ago.
0

There is no such config for this. It can be used in the same way as that in the web.php file.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

sslaravel nnngit Joined 26 Mar 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.