I have a form posting a title and a body. When i submit, nothing happens. I have a csrf field and i'm using the post method.
I have tried numerous different ways to declare the action and the method. I have tried to call the csrf field in different ways also. None of that worked.
Route:
Route::resource('/posts', 'PostsController');
Create.blade.php
<form action="{{route('posts.store')}}" method="POST">
@csrf
// removed @method('POST')
<div class="form-group">
<label for="title">Title</label>
<input type="text" name="title" class="form-control" placeholder="Title">
</div>
<div class="form-group">
<label for="body">Body</label>
<textarea name="body" placeholder="Body" class="form-control" cols="30" rows="10"></textarea>
</div>
<input type="button" name="submit" value="Submit" class="btn btn-primary">
</form>
PostsController:
public function store(Request $request)
{
return "Form posted";
}
Post model:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
//
}
Here i have all the available routes:

The store function in the PostsController is empty. So I expect to recieve an empty page when I submit, but nothing happens.
@method('POST'). Try runningphp artisan route:listand make sure you have a named route calledposts.store. - nakov