Created
May 6, 2020 06:21
-
-
Save Sankame/6cc553841d60ab142909ad7a75b951ee to your computer and use it in GitHub Desktop.
Sample code using Laravel, PHPUnit and Mockery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Show the form for editing the specified resource. | |
* | |
* @param int $id | |
* @return \Illuminate\Http\Response | |
*/ | |
public function edit($id) | |
{ | |
$contact = Contact::find($id); | |
//When you can not find the record, back to the home. | |
if($contact === null){ | |
return redirect('/contacts'); | |
} | |
return view('contacts.edit', compact('contact')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment