当前位置: 首页>>代码示例>>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;未经允许,请勿转载。