When i want to insert data in the database i get this error
MethodNotAllowedHttpException in RouteCollection.php line 219
I'm use resource controller
this is my form
<form action="library" method="POST" enctype="multipart/form-data">
{!! csrf_field() !!}
Enter the name of section: <input type="text" name="section_name"> <br>
Upload an image: <input type="file" name="image"> <br>
<button type="submit" class="btn btn-default">Create Section</button>
</form>
and this is my store function
public function store(Request $request)
{
$section_name = $request->input('section_name');
$file = $request->file('image');
$destenationPath = 'iamges';
$filename = $file->getClientOriginalName();
$file->move($destenationPath, $filename);
DB::table('sections')->insert(['section_name' => $section_name, 'image_name' => $filename]);
return redirect('admin');
}
and this my Route
Route::resource('library', 'Main');
action="{{action('Main@store')}}"
. – Ivanka Todorova