#Insert to table on button click
8 messages · Page 1 of 1 (latest)
It is ok to make a page reload. I just don't know 'algorithmitically' how to submit the form to a controller
#My blade file
<form method="POST" action="{{ route('my-route.store') }}">
@csrf
#My fields
<button type="submit">
{{ __('Submit') }}
</button>
</form>
#my Web.php routes file
Route::post('my-route', [ExampleController::class, 'store'])->name('my-route.store');
#my ExampleController store method
public function store(Request $request)
{
//Logic to store data from $request->fieldName here and return redirect
}
Is that what you're looking for?
Maybe check this out - https://laracasts.com/series/php-for-beginners/episodes/19
@orchid valley watching the video rn
Thanks a lot @orchid valley !!
You were able to get it working?