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


PHP Profile::fill方法代碼示例

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


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

示例1: addUserPost

 public function addUserPost()
 {
     $profile = Profile::where('no_gaji', Request::get('no_gaji'))->first();
     if (!empty($profile)) {
         Session::flash('error', 'Gagal. No gaji *' . Request::get('no_gaji') . '* bertindih.');
         return Redirect::back()->withInput();
     }
     $no_anggota = Profile::where('no_anggota', Request::get('no_anggota'))->first();
     if (!empty($no_anggota)) {
         Session::flash('error', 'Gagal. No anggota *' . Request::get('no_anggota') . '* bertindih.');
         return Redirect::back()->withInput();
     }
     $nokp = Profile::where('nokp', Request::get('nokp'))->first();
     if (!empty($nokp)) {
         Session::flash('error', 'Gagal. No KP *' . Request::get('nokp') . '* telah wujud, dengan No Gaji *' . $nokp->no_gaji . '*.');
         return Redirect::back()->withInput();
     }
     $validation = Validator::make(Request::all(), ['no_anggota' => 'required|numeric', 'no_gaji' => 'required|numeric', 'profile_category_id' => 'required|numeric', 'nama' => 'required', 'nokp' => 'required', 'jantina_id' => 'required', 'bangsa' => 'required', 'jumlah_yuran_bulanan' => 'required|numeric', 'zon_gaji_id' => 'required|numeric']);
     if ($validation->fails()) {
         Session::flash('error', 'Sila isikan ruangan dengan format yang betul');
         return Redirect::back()->withInput()->withErrors($validation);
     }
     $profile = new Profile();
     $profile->fill(Request::all());
     $profile->jumlah_yuran_bulanan = Request::get('jumlah_yuran_bulanan');
     $profile->nama = strtoupper(Request::get('nama'));
     $profile->tarikh_ahli = Carbon::now();
     $profile->jantina_id = Request::get('jantina_id');
     $profile->alamat1 = strtoupper(Request::get('alamat1'));
     $profile->alamat2 = strtoupper(Request::get('alamat2'));
     $profile->jawatan = strtoupper(Request::get('jawatan'));
     $profile->email = strtoupper(Request::get('email'));
     $profile->taraf_jawatan = strtoupper(Request::get('taraf_jawatan'));
     if ($profile->save()) {
         Session::flash('success', 'Berjaya. Anggota baru telah didaftarkan');
     } else {
         Session::flash('error', 'Gagal. Anggota baru gagal didaftarkan');
     }
     return Redirect::route('members.profiles.addUser');
 }
開發者ID:suhairi,項目名稱:komada,代碼行數:40,代碼來源:ProfileController.php


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