What are you using to access the route? A web form submission?
Nov 11, 2017
4
Level 2
Laravel - Route not accesable
Hello, I've come across something pretty weird. I made a route inside my web.php named Route::post('/vragen/create', 'PostController@store'); which is supposed to store a new post. But whenever I try to access that route, it tells me the page non-existent.
My PostController's store method looks like this:
public function store(Request $request)
{
dd($request->all());
return redirect($post->path());
}
If have DD'd the method to see what will return but I can't even access that. What is causing this?, Because I can't create posts this way, If I try to make a post I get the error 'No Message' instead of the DD I am supposed to get returned. What is causing this?
This is my whole routes file
Route::get('/', 'PostController@index')->name('home');
Route::get('/vragen', 'PostController@showQuestions')->name('showQuestions');
Route::post('/vragen/create', 'PostController@store');
Route::get('/vragen/{channel}', 'PostController@index');
Route::get('/vragen/{channel}/{post}', 'PostController@show');
Route::post('/vragen/{channel}/{post}/replies', 'ReplyController@store')->name('addReply');
Route::post('/replies/{reply}/likes', 'LikesController@store');
Route::get('/aanbieders', 'CompanyController@index')->name('showCompanies');
Route::get('/aanbieders/{channel}/{CompanyPost}', 'CompanyController@show');
Route::get('logout', function() {
Auth::logout();
return redirect('/');
});
Auth::routes();
Please or to participate in this conversation.