Home > Back-end >  How to send multiple variable from blade to controller
How to send multiple variable from blade to controller

Time:10-04

<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.

CodePudding user response:

<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 .

CodePudding user response:

Use form:

<form method="post" action="{{ url("/totalsales/{{  }}") }}">
    <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') }}"> 
    <input type="submit" value="Send">
</form>
  • Related