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


PHP Student::create方法代碼示例

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


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

示例1: store

 /**
  * @param CreateStudentRequest $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(StudentRequest $request)
 {
     //$input=Request::all();
     //$input['publichedAt']=Carbon::now();
     $student = Student::create($request->all());
     Session::flash('flash message', 'Task Successfully added');
     // return redirect()->back();
     return redirect('student');
 }
開發者ID:santoshpawar,項目名稱:laravelTodo,代碼行數:13,代碼來源:studentController.php

示例2: 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

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->authorize('edit', new Student());
     //$this->validate($request, ['name' => 'required']); // Uncomment and modify if you need to validate any input.
     Student::create($request->all());
     return redirect('student');
 }
開發者ID:afelipelc,項目名稱:Bachilleratos-Digitales-Laravel,代碼行數:12,代碼來源:StudentController.php

示例4: 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

示例5: 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

示例6: store

 public function store(StudentRequest $request)
 {
     $input = $request->all();
     $input['registered_at'] = time();
     $student = Student::create($input);
     return redirect()->route('settings.student');
     session()->flash('flash_message', 'You have been added 1 student!');
 }
開發者ID:arooth,項目名稱:Library-Management-System,代碼行數:8,代碼來源:StudentController.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateStudentRequest $request)
 {
     $request['password'] = Hash::make(ucfirst(strtolower($request->last_name)) . substr($request->student_number, -3));
     $request['student_group'] = "emphatic";
     Student::create($request->all());
     Auth::loginUsingId($request->student_number);
     $user = Auth::user();
     return Redirect::to('pia/method/manual')->with("user", $user);
 }
開發者ID:neilpeter08,項目名稱:thesis101,代碼行數:14,代碼來源:StudentController.php

示例8: store

 public function store(StudentRequest $request)
 {
     $student = Student::create($request->all());
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($student);
     }
     flash()->success('salvato con successo!');
     return redirect('students');
 }
開發者ID:sgazzoni,項目名稱:verifica_partecipanti_corso-1,代碼行數:9,代碼來源:StudentsController.php

示例9: 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

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(StudentRequest $request)
 {
     $input = $request->all();
     $student = Student::create(['name' => $input['name'], 'email' => $input['email'], 'telephone' => $input['telephone'], 'password' => bcrypt($input['password'])]);
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($user);
     }
     flash()->success('Benvenuto Bello!');
     return redirect('students');
 }
開發者ID:vergidul,項目名稱:verifica_partecipanti_corso,代碼行數:16,代碼來源:StudentsController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(AddStudentRequest $request)
 {
     $id = $request->get('student_number');
     $student = Student::where('student_number', $id)->first();
     if (count($student) > 0) {
         return response()->json(['success' => false, 'message' => 'Student number already exist']);
     }
     $student = Student::create(['student_number' => $request->get('student_number'), 'fname' => $request->get('fname'), 'lname' => $request->get('lname'), 'address' => $request->get('address'), 'zip' => $request->get('zip'), 'city' => $request->get('city'), 'state' => $request->get('state'), 'phone' => $request->get('phone'), 'mobile' => $request->get('mobile'), 'email' => $request->get('email'), 'year' => $request->get('year'), 'section_id' => $request->get('section_id'), 'dob' => $request->get('dob')]);
     if (!$student->save()) {
         return response()->json(['success' => false, 'message' => 'Failed to save record']);
     }
     return response()->json(['success' => true, 'message' => 'New student saved successfully!']);
 }
開發者ID:ramzdam,項目名稱:enrollment,代碼行數:19,代碼來源:StudentController.php

示例12: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  CreateStudentRequest $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateStudentRequest $request)
 {
     $student = Student::create(['student' => ucwords($request->student), 'bday' => $request->bday, 'gender' => $request->gender, 'email' => $request->email]);
     $address = Address::create(['contact11' => $request->contact11]);
     $student->addresses()->save($address);
     foreach (Auth::user()->schools()->lists('school_id')->toArray() as $k => $v) {
         $value = $v;
     }
     $school = School::find($value);
     $grade = Grade::find($request->grade_id);
     $student->schools()->attach($school);
     $student->grades()->attach($grade);
     return redirect('principal/create#student-tab')->withInput();
 }
開發者ID:Khande1n,項目名稱:ujval,代碼行數:20,代碼來源:StudentController.php

示例13: run

 /**
  * Run the users database seeds.
  *
  * @return void
  */
 public function run()
 {
     //DB::table('users')->delete();
     DB::table('students')->truncate();
     //$data = ['type' => '本科', 'nationality' => '湯加', 'stu_id' => '60902064', 'name_cn' => '卡卡拉', 'name_en' => 'KAKALA VINNIE BARBARINO', 'passport_id' => 'R012751', 'sex' => '男', 'birthday' => '19821125', 'school' => '計算機與通信工程學院', 'major' => '電子信息工程', 'admission_date' => '20090901', 'old_class' => '信息0904', 'new_class' => '電信10', 'language' => '中文', 'fee' => '自費', 'address' => '海澱區北京科技大學留學生公寓X-418', 'telephone' => '13611308019', 'email' => 'dejesus.silvestre@yahoo.com', 'note2' => '2011年9月學漢語'];
     Student::create(['stu_id' => '41053017', 'stu_type' => '在校生', 'type' => '本科', 'nationality' => '湯加', 'name_cn' => '陳培遠', 'name_en' => 'Gavin', 'passport_id' => 'R012751', 'gender' => '男', 'birthday' => '19821125', 'school' => '計算機與通信工程學院', 'major' => '電子信息工程', 'admission_date' => '20090901', 'old_class' => '信息0904', 'new_class' => '電信10', 'language' => '中文', 'fee_type' => '自費', 'inschool_address' => '海澱區北京科技大學留學生公寓X-418', 'telephone' => '13611308019', 'email' => 'dejesus.silvestre@yahoo.com']);
     Student::create(['stu_id' => 's20140023', 'stu_type' => '新生', 'type' => '碩士', 'nationality' => '中國', 'name_cn' => '陳培遠']);
     Student::create(['stu_id' => 'b20140326', 'stu_type' => '休學', 'type' => '博士', 'nationality' => '中國', 'name_cn' => '啥玩意1']);
     Student::create(['stu_id' => 'b20140327', 'stu_type' => '畢業結業', 'type' => '博士', 'nationality' => '中國', 'name_cn' => '啥玩意2']);
     Student::create(['stu_id' => 'b20140328', 'stu_type' => '退學轉學', 'type' => '博士', 'nationality' => '中國', 'name_cn' => '啥玩意3']);
     Student::create(['stu_id' => 'b20140329', 'stu_type' => '未報到', 'type' => '博士', 'nationality' => '中國', 'name_cn' => '啥玩意4']);
     Student::create(['stu_id' => 'b20140320', 'stu_type' => '休學', 'type' => '博士', 'nationality' => '中國', 'name_cn' => '啥玩意5']);
     //        $data['csc_no'] = null;
     //        $data['passport_id'] = null;
     //        for($i = 0; $i < 500; $i++)
     //        {
     //            $data['stu_id']++;
     //            $data['nationality'] = $i % 10;
     //            Student::create($data);
     //        }
 }
開發者ID:ChenPeiyuan,項目名稱:student-infomation-manager,代碼行數:26,代碼來源:DatabaseSeeder.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->authorize('create', new Inscription());
     //$this->validate($request, ['name' => 'required']); // Uncomment and modify if you need to validate any input.
     $schoolyear = Schoolyear::orderBy('id', 'DESC')->first();
     $request['school_id'] = Auth::user()->school_id;
     $request['schoolyear_id'] = $schoolyear->id;
     //student first
     $student = null;
     if (!isset($request['student_id']) || $request['student_id'] == 0) {
         $student = Student::create($request->all());
     } else {
         $student = Student::findOrFail($request['student_id']);
         $student->update($request->all());
     }
     $request['student_id'] = $student->id;
     $inscription = Inscription::create($request->all());
     //agregar al grupo
     $inscription->group->students->push($student);
     //return redirect('inscription');
     return view('inscription.step2', compact('inscription'));
 }
開發者ID:afelipelc,項目名稱:Bachilleratos-Digitales-Laravel,代碼行數:27,代碼來源:InscriptionController.php

示例15: create

 public function create(Request $request)
 {
     $validator = Student::validate();
     if ($validator->fails()) {
         return redirect()->route('students.new')->withErrors($validator)->withInput();
     }
     $student = Student::create(Input::all());
     //mass assignment
     //Display Flash msg on successful addition
     if ($student !== false) {
         if (is_null($request->input("interests"))) {
             //do nothing
         } else {
             //if saving of student is successful and interests is not null sync interests
             $student->interests()->sync($request->input("interests"));
         }
         Session::flash('message', "New student '" . $student->name . "' added successfully. ");
         return redirect()->route('students.index');
     } else {
         Session::flash('message', "Adding new student unsuccessful.");
         return redirect()->route('students.index');
     }
 }
開發者ID:hemant6488,項目名稱:Laravel-StudentManagementSystem,代碼行數:23,代碼來源:StudentController.php


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