Update ProfileSponsorController
This commit is contained in:
parent
f22a4b2d75
commit
bd61a921e8
|
@ -10,7 +10,8 @@ class ProfileSponsorController extends Controller
|
||||||
{
|
{
|
||||||
public function get(Request $request, $id)
|
public function get(Request $request, $id)
|
||||||
{
|
{
|
||||||
$res = ProfileSponsor::whereProfileId($id)->firstOrFail()->sponsors;
|
$profile = ProfileSponsor::whereProfileId($id)->first();
|
||||||
return response($res)->header('Content-Type', 'application/json');
|
$res = $profile ? $profile->sponsors : [];
|
||||||
|
return response()->json($res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue