I am new at Laravel. I am building a code that displays the records that have been checked. Following is my code.
{!! Form::open(array('action' => 'ClientsController@store','method' => 'POST', 'name' => 'f1'))!!}
@foreach($clients as $client)
{!! Form::checkbox('agree', $client->email, null, ['class' =>'questionCheckBox']) !!}
<article>
{{ $client->user_name }}
{{ $client->email }}
</article>
@endforeach
{!! Form::close() !!}
{!! Form::open(array('action' => 'ClientsController@display','method' => 'GET'))!!}
<div class="form-group">
{!! Form::submit('show-selected ',['class' => 'btn btn-primary form-control']) !!}
</div>
{!! Form::close() !!}
I have to display $client->emai
l when I click button "show-selected"
.
My controller method is,
public function display() {
$client = Client::all();
dd(Input::has('agree'));
$client = Input::has('agree') ? true : false;
return $client->email;
}
This should return true
, but it is returning false
, I am not getting how to get the values of checked check boxes on another page.