Skip to content
Advertisement

How to send multiple variable from blade to controller

<input type="date" class="form-control" name="from" value="{{ date('Y-m-d') }}">&nbsp;
<input type="date" class="form-control" name="to" value="{{ date('Y-m-d') }}"> 
<a href="{{ url("/totalsales/{{  }}") }}"></a>

i want to send ‘from’ and ‘to’ to controller from blade. how to write that in the tag. the necessary code is mentioned above. Thanks for your help in advance.

Advertisement

Answer

<form method="post" action="{{ URL("/totalsales/") }}">
<input type="datetime-local" class="form-control" name="from" >&nbsp;
<input type="datetime-local" class="form-control" name="to" > 
<input type="submit" class = "btn btn-primary">

this is the method to send data in controller your route should be post .

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement