本文整理汇总了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);
}
示例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();
示例3: testMember
public function testMember()
{
$member = Member::findOrFail(1);
$this->assertTrue($member->FirstName == 'Todd');
}
示例4: memberaccounts
public function memberaccounts($id)
{
$member = Member::findOrFail($id);
return View::make('savingaccounts.memberaccounts', compact('member'));
}
示例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);
}
示例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();
}