Reputation: 1845
I'm really not sure why my controller is not receiving the attribute and value input! Here's my system.
View
<form method="POST" action="create/attribute">
{{ csrf_field() }}
<div class="12u$">
<input type="text" id="attribute" >
<input type="text" id="value" >
</div>
<div class="12u$">
<ul class="actions">
<li><input type="submit" value="Submit" class="special" /></li>
<li><input type="reset" value="Reset" /></li>
</ul>
</div>
</form>
Controller
public function store()
{
dd(request()->all());
}
route
Route::post('/stimulus/create/attribute', 'Attributes@store');
When I press submit I receive
array:1 [▼
"_token" => "K4TSq9lVQq8etkH8lPDxfUJ8g9oF58wm2kJ2pwlz"
]
But nothing else. I'm really unsure what I'm missing here!
Upvotes: 3
Views: 7119
Reputation: 38542
You are missing the name
attribute on both of the input element inside the form
<input type="text" name="attribute" id="attribute" />
^
<input type="text" name ="value" id="value" />
^
and then fix the store
function inside controller
public function store(Request $request)
{
dd(request()->all());
}
Upvotes: 8