Last active
August 29, 2015 14:14
-
-
Save meisheep/f343f254308e6a58e14e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class JudgementController extends \BaseController { | |
/** | |
* Display a listing of the resource. | |
* | |
* @return Response | |
*/ | |
public function index() | |
{ | |
$wheres = array( | |
'name' => Input::get('name'), | |
'court' => Input::get('court'), | |
'year' => Input::get('year'), | |
'case' => Input::get('case'), | |
'no' => Input::get('no'), | |
'date' => Input::get('date'), | |
'cause' => Input::get('cause') | |
); | |
$judgements = new Judgement; | |
foreach($wheres as $key => $val) { | |
if($val) { | |
$judgements = $judgements->where($key, 'LIKE' , "%$val%"); | |
} | |
} | |
$judgements = $judgements->get(); | |
return Response::json(array( | |
'error' => false, | |
'judgements' => $judgements->toArray()), | |
200 | |
); | |
} | |
/** | |
* Show the form for creating a new resource. | |
* | |
* @return Response | |
*/ | |
public function create() | |
{ | |
// | |
} | |
/** | |
* Store a newly created resource in storage. | |
* | |
* @return Response | |
*/ | |
public function store() | |
{ | |
// | |
} | |
/** | |
* Display the specified resource. | |
* | |
* @param int $id | |
* @return Response | |
*/ | |
public function show($id) | |
{ | |
// | |
} | |
/** | |
* Show the form for editing the specified resource. | |
* | |
* @param int $id | |
* @return Response | |
*/ | |
public function edit($id) | |
{ | |
// | |
} | |
/** | |
* Update the specified resource in storage. | |
* | |
* @param int $id | |
* @return Response | |
*/ | |
public function update($id) | |
{ | |
// | |
} | |
/** | |
* Remove the specified resource from storage. | |
* | |
* @param int $id | |
* @return Response | |
*/ | |
public function destroy($id) | |
{ | |
// | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment