Watch this https://drive.google.com/file/d/0B1_PFw--3o74YjVreHNBOWU2aEE/view?usp=sharing
An example is using `like'
$dogsearch = (isset($_REQUEST['psch']) <> '' ? Cln::fixValue($_REQUEST['psch']) : "");
$dogsch = $dogsearch . "%";
$aval = (isset($_REQUEST['aval']) <> '' ? Cln::fixValue($_REQUEST['aval']) : "");
change to laravel request if desired
and
$query = Dog::where('dogname', 'like', $dogsch);
if ($aval == "n") {
$query->where('adopted', '=', 1);
} else if ($aval == "y") {
$query->where('adopted', '=', 0);
}
$dogs = $query->orderBy('lastedit', 'DESC')->paginate(5);
$pagelinks = array('psch' => $dogsearch, 'aval' => $aval);
and view
echo '<td>' . $dogs->appends($pagelinks)->links() . '</td>';
Of course all passed to view with ->with statements.
And the little form at top of list page to perform a search:
<div>
<form method="post" action="dog/indexadmin">
<!--<form method="post" action="<?php //echo DIR; ?>dog/indexadmin">-->
<label>sch</label><input type="text" name="psch" value="">
<label>Avail y or n</label><input type="text" name="aval" value="" size="10">
<input type="submit" name="submit" value="Search">
</form>
</div>
Many ways to do this.