Can you explain your question, possibly with an example of what you are actually trying to achieve?
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
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
@faisal this view route is not working laravel8.83.5 y so, if i give get and funtion for view it is working
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
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
no err ,not responding any @faisal any config is there to use view verb in route ~>api.php
There is no such config for this. It can be used in the same way as that in the web.php
file.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community