当前位置: 首页>>代码示例>>PHP>>正文


PHP app\Student类代码示例

本文整理汇总了PHP中app\Student的典型用法代码示例。如果您正苦于以下问题:PHP Student类的具体用法?PHP Student怎么用?PHP Student使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Student类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\CreateStudentRequest $request)
 {
     $data = $request->all();
     $student = new Student($data);
     $student->save();
     return redirect()->route('admin.student.index');
 }
开发者ID:JJHdez,项目名称:OpenTpmW,代码行数:12,代码来源:StudentsController.php

示例2: saveFile

 public function saveFile()
 {
     $csvFile = Input::file('file');
     $file_handle = fopen($csvFile, 'r');
     while (!feof($file_handle)) {
         $line_of_text = fgetcsv($file_handle, 1024);
         if ($line_of_text != null) {
             $studentData[] = array('stud_idno' => $line_of_text[0], 'lastname' => $line_of_text[2], 'firstname' => $line_of_text[3], 'middlename' => $line_of_text[4], 'yr_sec' => $line_of_text[5], 'course' => $line_of_text[6], 'college' => $line_of_text[7]);
         }
     }
     fclose($file_handle);
     $errorList = array();
     $i = 1;
     foreach ($studentData as $student) {
         $validator = Validator::make($student, ['stud_idno' => 'unique:students|regex:/^\\d{2}-+\\d{4}$/', 'lastname' => 'min:2', 'firstname' => 'min:2']);
         if ($validator->fails()) {
             foreach ($validator->errors()->all() as $err) {
                 $errorList[] = 'Line ' . $i . ' - ' . $err;
             }
         } else {
             $stud = new Student();
             $stud->student_guid = Uuid::uuid();
             $stud->stud_idno = $student['stud_idno'];
             $stud->firstname = $student['firstname'];
             $stud->middlename = $student['middlename'];
             $stud->lastname = $student['lastname'];
             $stud->college = $student['college'];
             $stud->course = $student['course'];
             $stud->yr_sec = $student['yr_sec'];
             $stud->save();
         }
         $i++;
     }
     return $errorList;
 }
开发者ID:rozxel21,项目名称:sim,代码行数:35,代码来源:AdminSaveController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $student = new Student();
     $data = $request->all();
     $student->fill($data);
     $student->save();
     return redirect('classrooms/' . $data["classroom_id"]);
 }
开发者ID:speachy-20,项目名称:classmate,代码行数:13,代码来源:StudentsController.php

示例4: destroy

 public function destroy(Request $request, Student $student)
 {
     $student->delete();
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($student);
     }
     return redirect('students');
 }
开发者ID:sgazzoni,项目名称:verifica_partecipanti_corso-1,代码行数:8,代码来源:StudentsController.php

示例5: information

 /**
  * @param Student $stud
  * @return \Illuminate\View\View
  */
 public function information(Student $stud)
 {
     //$stud=new Student();
     $stud->name = 'khan';
     $stud->father_name = "baap of khan";
     $stud->roll_number = "420";
     $stud->save();
     //$info = $stud::withTrashed();
     //$info->delete();
     //$stud->destroy(4);
     return view('songs.song', compact('info'));
 }
开发者ID:jabrankhalil,项目名称:laravel,代码行数:16,代码来源:StudentController.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     /**************
       	ADMIN DB ENTRY*
       	**************/
     $user = new User();
     $user->username = "nelabh";
     $user->password = Hash::make('helloworld');
     $user->level = 0;
     $user->save();
     /**************
       	TEACHER DB ENTRY*
       	**************/
     $user = new User();
     $user->username = "nelabhteach";
     $user->password = Hash::make('helloworld');
     $user->level = 2;
     $user->save();
     /**************
       	STUDENT DB ENTRY*
       	**************/
     $user = new User();
     $user->username = "nelabhstudent";
     $user->password = Hash::make('helloworld');
     $user->level = 1;
     $user->save();
     // $this->call(UsersTableSeeder::class);
     /**************
        STUDENT DB ENTRY*
        **************/
     $student = new Student();
     $student->name = "Sahil Kumar Maurya";
     $student->username = "nelabhstudent";
     $student->email = "sahil.kr.maurya@gmail.com";
     $student->phone_no = 1234567890;
     $student->admission_year = 2014;
     $student->course = "Bachelor of Technology";
     $student->branch = "Computer Science Engineering";
     $student->save();
     /**************
        TEACHER DB ENTRY*
        **************/
     $staff = new Staff();
     $student->name = "S.K. Maurya";
     $student->username = "nelabhteach";
     $student->email = "sahil.kr.maurya@gmail.com";
     $student->phone_no = 1234567890;
     $student->type = 1;
     $student->subject = "Networking";
     $student->depart = "Computer Science Engineering";
     $staff->save();
 }
开发者ID:ncs-jss,项目名称:library,代码行数:57,代码来源:DatabaseSeeder.php

示例7: store

 public function store(StudentAdd $request)
 {
     $student = Student::create($request->all());
     flash('Student Registered', $student->first_name . ' has been added.');
     return back();
     /*return redirect()->route('reports');*/
 }
开发者ID:ljiriko,项目名称:hp_test1,代码行数:7,代码来源:StudentsController.php

示例8: boot

 protected static function boot()
 {
     // TODO send email with randomly generated password
     Student::created(function ($student) {
         $student->university->user()->create(['name' => $student->first_name . ' ' . $student->last_name, 'email' => $student->email, 'password' => bcrypt('1234'), 'role' => 'student']);
     });
 }
开发者ID:BootySYS,项目名称:bootysys,代码行数:7,代码来源:Student.php

示例9: boot

 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     $router->bind('students', function ($id) {
         return \App\Student::where('id', $id)->firstOrFail();
     });
     parent::boot($router);
 }
开发者ID:MP86,项目名称:verifica_partecipanti_corso-1,代码行数:13,代码来源:RouteServiceProvider.php

示例10: createQuery

 /**
  * @param StudentSearch $request
  * @return mixed
  */
 private function createQuery(StudentSearch $request)
 {
     if (!$this->search->createQuery($request->all())) {
         return Student::orderBy('last_name', 'ASC')->paginate(10);
     }
     return $this->search->createQuery($request->all())->paginate(10);
 }
开发者ID:arielmagbanua,项目名称:sis_test,代码行数:11,代码来源:ReportsController.php

示例11: getStudent

 public function getStudent($id)
 {
     if (Request::ajax()) {
         $student = Student::with('college', 'course', 'scholarship', 'educationalBackground', 'familyBackground', 'academicPerformance', 'organizationalAffiliation', 'psychologicalTest', 'activityParticipated', 'counsellingRecord', 'absentRecord')->where('students.id', $id)->get();
         return $student;
     }
 }
开发者ID:humbleBeginner,项目名称:unp_guidanceRMS,代码行数:7,代码来源:AjaxSourceController.php

示例12: time

 public function time()
 {
     $client = new Client(['base_uri' => config('bootysys.base_url'), 'timeout' => 2.0]);
     $professor = Student::all();
     $req = $client->request('POST', '/receive', ['json' => ['professors' => $professor]]);
     return collect(['body' => $req->getBody()->getContents()]);
 }
开发者ID:BootySYS,项目名称:bootysys,代码行数:7,代码来源:DistributionServerController.php

示例13: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $students = array(['id_no' => '1', 'name' => 'muse cali', 'gender_type_id' => 1, 'tel' => '123-123-456', 'batch_id' => 1, 'enrollment_date' => date("Y-m-d"), 'date_of_birth' => date("Y-m-d"), 'guardians_id' => 1, 'user_id' => 1]);
     foreach ($students as $student) {
         Student::create($student);
     }
 }
开发者ID:ducaale,项目名称:university-management-app,代码行数:13,代码来源:studentsTableSeeder.php

示例14: generate

 public function generate($id)
 {
     $college = $this->checkCollege($id);
     $students = Student::where('college', 'LIKE', '%' . $college . '%')->orderBy('lastname')->get();
     $pdf = \PDF::loadView('layouts.spreadsheet', compact('students'));
     //return view('layouts.spreadsheet', compact('students'));
     return $pdf->download('test.pdf');
 }
开发者ID:neilpeter08,项目名称:thesis101,代码行数:8,代码来源:GenerateController.php

示例15: up

 public function up($id)
 {
     $dateNow = time();
     $student = Student::findOrFail($id);
     $student->update(['status' => 1, 'registered_at' => $dateNow]);
     session()->flash('flash_message', 'Anda telah melakukan perpanjangan masa aktif siswa!');
     return redirect()->route('settings.student');
 }
开发者ID:arooth,项目名称:Library-Management-System,代码行数:8,代码来源:StudentController.php


注:本文中的app\Student类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。