Exemplo n.º 1
0
 public static function studentSearch($data)
 {
     $search = trim(Str::upper($data['student_search']));
     $result = Student::where('regno', 'LIKE', $search . '%')->where('regno', 'LIKE', 'BHU%')->orWhere('firstname', 'LIKE', $search . '%')->orWhere('surname', 'LIKE', $search . '%')->where('telno', '!=', '')->whereIn('levelid', [1, 2, 3, 4, 5, 6]);
     $allResult = $result->get(['regno', 'firstname', 'surname', 'telno', 'nokgsm']);
     $paginatedResult = $result->paginate(30, ['regno', 'firstname', 'surname', 'telno', 'nokgsm']);
     return ['allResult' => $allResult, 'paginatedResult' => $paginatedResult];
 }
Exemplo n.º 2
0
 public function export_csv()
 {
     Student::exportCsv(Input::all());
 }