mirror of
https://github.com/anna-sara/vbytes_lan.git
synced 2026-03-16 16:25:41 +01:00
Updated data you get from api
This commit is contained in:
parent
00dac42e2c
commit
cfaddeec45
3 changed files with 25 additions and 14 deletions
|
|
@ -18,8 +18,12 @@ class ParticipantController extends Controller
|
|||
|
||||
if ($permission === "key_1") {
|
||||
|
||||
$participants = Participant::all()->makeHidden(['comment', 'emailed', 'paid', 'member', 'gdpr']);
|
||||
$volunteers = Volunteer::all()->makeHidden(['gdpr', 'emailed']);
|
||||
$participants = Participant::whereNotNull('lan_id')
|
||||
->select('id','lan_id', 'first_name', 'surname','grade','phone','email', 'guardian_name', 'guardian_phone', 'guardian_email', 'is_visiting','friends', 'special_diet', 'status','created_at', 'updated_at')
|
||||
->get();
|
||||
$volunteers = Volunteer::whereNotNull('lan_id')
|
||||
->select('id','lan_id', 'first_name', 'surname','phone','email', 'areas', 'created_at', 'updated_at')
|
||||
->get();
|
||||
|
||||
$dataArr = [
|
||||
'code' => 200,
|
||||
|
|
@ -32,8 +36,8 @@ class ParticipantController extends Controller
|
|||
|
||||
if ($permission === "key_2") {
|
||||
|
||||
$participants = Participant::all()->select('participant_id', 'first_name', 'surname');
|
||||
$volunteers = Volunteer::all()->select('first_name', 'surname');
|
||||
$participants = Participant::whereNotNull('lan_id')->select('lan_id', 'first_name', 'surname', 'guardian_name')->get();
|
||||
$volunteers = Volunteer::whereNotNull('lan_id')->select('lan_id','first_name', 'surname')->get();
|
||||
|
||||
$dataArr = [
|
||||
'code' => 200,
|
||||
|
|
@ -46,7 +50,9 @@ class ParticipantController extends Controller
|
|||
|
||||
if ($permission === "key_3") {
|
||||
|
||||
$participants = Participant::all()->makeHidden(['comment', 'emailed', 'paid', 'member', 'gdpr']);
|
||||
$participants = Participant::whereNotNull('lan_id')
|
||||
->select('id','lan_id', 'first_name', 'surname','grade','phone','email', 'guardian_name', 'guardian_phone', 'guardian_email', 'is_visiting','friends', 'special_diet', 'status','created_at', 'updated_at')
|
||||
->get();
|
||||
|
||||
return $dataArr = [
|
||||
'code' => 200,
|
||||
|
|
@ -56,7 +62,7 @@ class ParticipantController extends Controller
|
|||
|
||||
if ($permission === "key_4") {
|
||||
|
||||
$participants = Participant::all()->select('participant_id', 'first_name', 'surname');
|
||||
$participants = Participant::whereNotNull('lan_id')->select('lan_id', 'first_name', 'surname', 'guardian_name')->get();
|
||||
|
||||
return $dataArr = [
|
||||
'code' => 200,
|
||||
|
|
|
|||
|
|
@ -70,12 +70,15 @@
|
|||
{
|
||||
"participants": [
|
||||
{
|
||||
"lan_id": 1,
|
||||
"first_name": "John",
|
||||
"surname": "Doe"
|
||||
"surname": "Doe",
|
||||
"guardian_name": "John Doe"
|
||||
}
|
||||
],
|
||||
"volunteers": [
|
||||
{
|
||||
"lan_id": 1,
|
||||
"first_name": "Jane",
|
||||
"surname": "Doe"
|
||||
}
|
||||
|
|
@ -114,8 +117,10 @@
|
|||
{
|
||||
"participants": [
|
||||
{
|
||||
"lan_id": 1,
|
||||
"first_name": "John",
|
||||
"surname": "Doe"
|
||||
"surname": "Doe",
|
||||
"guardian_name": "John Doe"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
## API Keys
|
||||
|
||||
> | key | permissions |
|
||||
> |--------------|-----------------------------------------------------------------------|
|
||||
> |--------------|--------------------------------------------------------------------------------------|
|
||||
> | `KEY 1` | All data from Participants and Volunteers. Can post |
|
||||
> | `KEY 2` | {lan_id, first_name, surname} from table Participants and Volunteers |
|
||||
> | `KEY 2` | {lan_id, first_name, surname, guardian_name} from table Participants and Volunteers |
|
||||
> | `KEY 3` | All data from table Participants |
|
||||
> | `KEY 4` | {lan_id, first_name, surname} from table Participants |
|
||||
> | `KEY 4` | {lan_id, first_name, surname, guardian_name} from table Participants |
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue