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


PHP Member::findOrFail方法代码示例

本文整理汇总了PHP中Member::findOrFail方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::findOrFail方法的具体用法?PHP Member::findOrFail怎么用?PHP Member::findOrFail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Member的用法示例。


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

示例1: update

 /**
  * Update the specified kin in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $kin = Kin::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Kin::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $member = Member::findOrFail(Input::get('member_id'));
     $kin->member()->associate($member);
     $kin->name = Input::get('name');
     $kin->rship = Input::get('rship');
     $kin->goodwill = Input::get('goodwill');
     $kin->id_number = Input::get('id_number');
     $kin->update();
     return Redirect::to('members/show/' . $member->id);
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:22,代码来源:KinsController.php

示例2: function

/*
* orders controllers
*/
Route::resource('orders', 'OrdersController');
Route::post('orders/update/{id}', 'OrdersControler@update');
Route::get('orders/edit/{id}', 'OrdersControler@edit');
Route::get('orders/delete/{id}', 'OrdersControler@destroy');
Route::get('savings', function () {
    $mem = Confide::user()->username;
    $memb = DB::table('members')->where('membership_no', '=', $mem)->pluck('id');
    $member = Member::find($memb);
    return View::make('css.savingaccounts', compact('member'));
});
Route::post('loanguarantors', function () {
    $mem_id = Input::get('member_id');
    $member = Member::findOrFail($mem_id);
    $loanaccount = Loanaccount::findOrFail(Input::get('loanaccount_id'));
    $guarantor = new Loanguarantor();
    $guarantor->member()->associate($member);
    $guarantor->loanaccount()->associate($loanaccount);
    $guarantor->amount = Input::get('amount');
    $guarantor->save();
    return Redirect::to('memloans/' . $loanaccount->id);
});
Route::get('backups', function () {
    //$backups = Backup::getRestorationFiles('../app/storage/backup/');
    return View::make('backup');
});
Route::get('backups/create', function () {
    echo '<pre>';
    $instance = Backup::getBackupEngineInstance();
开发者ID:kenkode,项目名称:umash,代码行数:31,代码来源:routes.php

示例3: testMember

 public function testMember()
 {
     $member = Member::findOrFail(1);
     $this->assertTrue($member->FirstName == 'Todd');
 }
开发者ID:smarcet,项目名称:openstackid,代码行数:5,代码来源:UserTest.php

示例4: memberaccounts

 public function memberaccounts($id)
 {
     $member = Member::findOrFail($id);
     return View::make('savingaccounts.memberaccounts', compact('member'));
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:5,代码来源:SavingaccountsController.php

示例5: cssupdate

 public function cssupdate($id)
 {
     $mem_id = Input::get('member_id');
     $member = Member::findOrFail($mem_id);
     $loanaccount = Loanaccount::findOrFail(Input::get('loanaccount_id'));
     $guarantor = Loanguarantor::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Loanguarantor::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $guarantor->member()->associate($member);
     $guarantor->loanaccount()->associate($loanaccount);
     $guarantor->amount = Input::get('amount');
     $guarantor->save();
     return Redirect::to('memloans/' . $loanaccount->id);
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:16,代码来源:LoanguarantorsController.php

示例6: reset

 public function reset($id)
 {
     //$id = DB::table('members')->where('membership_no', '=', $mem)->pluck('id');
     $member = Member::findOrFail($id);
     $user_id = DB::table('users')->where('username', '=', $member->membership_no)->pluck('id');
     $user = User::findOrFail($user_id);
     $user->password = Hash::make('tacsix123');
     $user->update();
     return Redirect::back();
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:10,代码来源:MembersController.php


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