當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Student::all方法代碼示例

本文整理匯總了PHP中app\models\Student::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Student::all方法的具體用法?PHP Student::all怎麽用?PHP Student::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\Student的用法示例。


在下文中一共展示了Student::all方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     foreach (Student::all() as $student) {
         $picture = file_get_contents('http://local-sig.utt.fr/Pub/trombi/individu/' . $student->student_id . '.jpg');
         file_put_contents(public_path() . '/uploads/students-trombi/' . $student->student_id . '.jpg', $picture);
     }
     $this->info('Done!');
 }
開發者ID:ungdev,項目名稱:integration-UTT,代碼行數:13,代碼來源:ImportStudentPictures.php

示例2: index

 public function index()
 {
     $students = Student::all();
     foreach ($students as $student) {
         $user = $student->user()->first();
         $student['name'] = $user->name;
         $student['email'] = $user->email;
     }
     return $students;
 }
開發者ID:Kryptonitesoft,項目名稱:quizapp,代碼行數:10,代碼來源:StudentController.php

示例3: getIndex

 function getIndex()
 {
     $data['list_students'] = Student::all();
     return view('hocsinh.index')->with('data', $data);
 }
開發者ID:b0yblake1,項目名稱:duan,代碼行數:5,代碼來源:StudentController.php

示例4: exportStudentList

 public function exportStudentList()
 {
     // work on the export
     $csv = \League\Csv\Writer::createFromFileObject(new \SplTempFileObject());
     $csv->setOutputBOM(Reader::BOM_UTF8);
     $dbColumn = Input::get('hdndbColumn');
     $value = Input::get('hdnvalue');
     if ($dbColumn != "all") {
         $infos = Student::where($dbColumn, '=', $value)->orderBy('lname', 'asc')->get();
     } else {
         $infos = Student::all();
     }
     $headers = Schema::getColumnListing('student_record');
     $notInclude = ["id", "created_at", "updated_at"];
     $x = 0;
     foreach ($headers as $header) {
         if (in_array($header, $notInclude)) {
             unset($headers[$x]);
         }
         $x++;
     }
     $csv->insertOne($headers);
     foreach ($infos as $info) {
         $data = array();
         foreach ($headers as $header) {
             if ($header == "section") {
                 $data[count($data)] = $this->secInfo($info[$header])['description'];
             } elseif ($header == "year_lvl") {
                 $data[count($data)] = $this->yearInfo($info[$header])['description'];
             } else {
                 $data[count($data)] = $info[$header];
             }
         }
         $csv->insertOne($data);
     }
     $date_now = date('Y-m-d-H:i:s');
     $filename = 'student_record(' . $date_now . ').csv';
     $csv->output($filename);
 }
開發者ID:jhunel2389,項目名稱:hp-sis,代碼行數:39,代碼來源:GlobalController.php

示例5: all

 /**
  * Returns all Students
  *
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function all()
 {
     return Student::all();
 }
開發者ID:amandiotsungo,項目名稱:ExameNormal,代碼行數:9,代碼來源:StudentRepository.php


注:本文中的app\models\Student::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。