Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 14 |
PeopleController | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 14 |
__construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
index | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 6 |
|||
show | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 7 |
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Support\Facades\DB; | |
class PeopleController extends Controller | |
{ | |
/** | |
* Create a new controller instance. | |
* | |
* @return void | |
*/ | |
public function __construct() | |
{ | |
// | |
} | |
public function index($church_id) { | |
$people = DB::table('people') | |
->where('church_id', '=', $church_id) | |
->select([ | |
'id', 'church_id', 'campus_id', | |
'first_name', 'middle_name', 'last_name', | |
'email', 'status', 'address', 'city', | |
'state', 'zip']) | |
->get(); | |
return response()->json($people); | |
} | |
public function show($church_id, $person_id) { | |
$person = DB::table('people') | |
->where('church_id', '=', $church_id) | |
->where('id', '=', $person_id) | |
->select([ | |
'id', 'church_id', 'campus_id', | |
'first_name', 'middle_name', 'last_name', | |
'email', 'status', 'address', 'city', | |
'state', 'zip']) | |
->get(); | |
return response()->json($person); | |
} | |
} |