#How to route a view.
45 messages · Page 1 of 1 (latest)
@calm radish that hasn't changed anything - still 404.
When using view it looks inside the views folder in your project directory
I think there is a prefix defination in the RouteProvider, and Could you provide the error URL without hosts ?
So if you have a page named pageName.blade.php it will look for a file named pageName.blade.php
I have tried the code you provided, it is working well.
Of course you can run the shell under your Laravel project dir
php artisan route:list | grep hourly
and find the route you wrote. I think it would be helpful for you.
Show code….
Would that influence?
show me the code ..
Ah
It is okay
I figured it
The resource changes the route beginning.
I believe.
Do you mean there is a route conflict in your routes? like
Route::resource('one',...);
Route::view('/one/hourly', 'one.hourly');
I think you should not do this.
Could you let me know if this resource has a details api, or could you change the new route path to another path?
I need it on the same path
@thick locust if you need help. Send us the code in your route file you wish to fix
We don’t have telepathy
@calm radish there was an issue with the Route::resource and the Route::get but I just moved the get above the resource and it works.
Jacky Chen is saying that is bad practice, what should I do instead?
Show me the code
Do I need to move the route to the middleware?
could you let me know is there a scene that two routes are same routes; like following codes:
Route::get('/one/hourly',.....);
Route::resource('/one',....);// but the resource_id in the route '/one/{resource_id}' is as same sa 'hourly'?
There is likely a conflict between your custom route and the resource route. But we can’t help sufficiently if we don’t see the code…. 🤦♂️
That is not possible
@static stump All that is left is to name the route.
I did this, but now all my app renders is the name of the view path.
Route::get('one/hourly', function(){
return view('module.one.hourly');
})->name('one.hourly');```

I am stupid.
I fixed.
what is issue ?