In Laravel 5.5 what I usually do is this:
First create a controller that will be used to manipulate your data with the console, type:
php artisan make:controller NameHereController
In my form, I put an action with this controller name as
<form id="uploadForm" method="POST" action="{{ action('NameHereController@store') }}"
enctype="multipart/form-data">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('description') ? ' has-error' : '' }} formField">
<label for="comment">Describe what you see(To help the DirtBusters finding it)</label>
<textarea class="form-control" rows="5" name="description" maxlength="750" required
autofocus>{{ ucfirst($markers->description) }}</textarea>
@if ($errors->has('description'))
<span class="help-block">
<strong>{{ $errors->first('description') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<button type="submit" name="button" class="btn btn-primary">Send!</button>
</div>
</form>
Remember to add the {{ csrf_field() }} or you will get problems.
Now in the controller Store function, I add this:
public function store(Request $request)<--this is the data from your form
{
$validator = Validator::make($request->all(), [
'description' => 'required|string|min:2|max:750'<--set it to whatever you like
]);
if ($validator->fails()) { <--if the validation fails return with the errors
return back()
->withErrors($validator)
->withInput();
}else{
DB::table('yourTable')->insert(array(
'description' => $request->get('description')
));
return back()->with('success', 'Thank you for your hard work!');
Hope this helps,
ps:I used the multipart in my form post because initially, this form had images in the request....