I need to include a string-shaped data in the table in my database that I will get through the input, which in turn is an array. Follow the form for you to see how it is.
<div class="form-inline col-md-12">
<div class="form-group col-md-4">
<label for="create-contest-theme#1" class="control-label">1º Tema: </label>
<div class="input-group">
<input type="text" name="theme[]" id="create-contest-theme#1" class="form-control">
</div>
</div>
<div class="form-group col-md-4">
<label for="create-contest-theme#2" class="control-label">2º Tema: </label>
<div class="input-group">
<input type="text" name="theme[]" id="create-contest-theme#2" class="form-control">
</div>
</div>
<div class="form-group col-md-4">
<label for="create-contest-theme#3" class="control-label">3º Tema: </label>
<div class="input-group">
<input type="text" name="theme[]" id="create-contest-theme#3" class="form-control">
</div>
</div>
</div>
The action of this form points to the function create of my controller:
public function create(CreateRequest $request){
$inputs = $request->except('_token');
$contest = Contest::create($inputs);
return $contest;
}
The Constest model
class Contest extends Model
{
protected $table = 'contests';
}
And my big question is: How to treat this input theme
so that it is a string when it is stored?