• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP app\Student类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了Student类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 = "[email protected]";
     $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 = "[email protected]";
     $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


示例16: students

 public function students()
 {
     if (!Session::has('admin')) {
         return redirect('/admin/login');
     }
     $students = Student::where('validated', true)->get();
     return view('admin/students', ['students' => $students]);
 }
开发者ID:arush0311,项目名称:treasure-hunt,代码行数:8,代码来源:AdminController.php


示例17: run

 public function run()
 {
     DB::table('students')->delete();
     Student::create(['festember_id' => '1', 'card' => 'aXnfhFSsfds', 'name' => 'Rishi Rajasekaran', 'roll_no' => '106113078', 'facebook_id' => 'rajasekaran.rishi']);
     Student::create(['festember_id' => '2', 'card' => 'bFDDhfqFdxs', 'name' => 'Suyash Behera', 'roll_no' => '106113096', 'facebook_id' => 'sne9x']);
     Student::create(['festember_id' => '3', 'card' => '0013276499', 'name' => 'Siddarth Iyer', 'roll_no' => '106113089', 'facebook_id' => 'mindstormer619']);
     Student::create(['festember_id' => '4', 'card' => 'DjqpdfDjshf', 'name' => 'Desikan S', 'roll_no' => '106113093', 'facebook_id' => 'desikan93']);
 }
开发者ID:rishihot55,项目名称:festember-photobooth-demo,代码行数:8,代码来源:DatabaseSeeder.php


示例18: export

 /**
  * Export students (query in session) to excel
  *
  * @return mixed
  */
 public function export()
 {
     $students = session()->has('students') ? session('students')->get() : Student::get();
     return \Excel::create('Students', function ($excel) use($students) {
         $excel->sheet('students', function ($sheet) use($students) {
             $sheet->fromArray($students->toArray());
         });
     })->download('xls');
 }
开发者ID:ljiriko,项目名称:hp_test1,代码行数:14,代码来源:ReportsController.php


示例19: run

 public function run()
 {
     //remember to run this from the VM...
     //        DB::table('student')->delete();
     $faker = Faker::create();
     for ($i = 0; $i < 25; $i++) {
         Student::create(['name' => $faker->name(), 'created_at' => $faker->dateTime, 'updated_at' => $faker->dateTime]);
     }
 }
开发者ID:rrubiorr81,项目名称:flyer,代码行数:9,代码来源:StudentTableSeeder.php


示例20: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $learners = \App\Student::all();
     $staff = Staff::all();
     $subjects = \App\Subject::all();
     $streams = \App\Stream::all();
     $classes = \App\Grade::all();
     return view('admin.index')->with('title', 'SMS|Dashboard')->with('learners', $learners)->with('staff', $staff)->with('subjects', $subjects)->with('streams', $streams)->with('classes', $classes);
 }
开发者ID:eyamu,项目名称:sms,代码行数:14,代码来源:AdminController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP app\Tag类代码示例发布时间:2022-05-23
下一篇:
PHP app\Setting类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap