Created
August 18, 2017 12:34
-
-
Save achmadfatoni/535fb95379b75623644ce7ee5e50cb4f to your computer and use it in GitHub Desktop.
simple_api_lumen_single_controller
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
public function show($id) | |
{ | |
$post = Post::find($id); | |
if (! $post) { | |
return response()->json([ | |
'message' => 'post not found' | |
]); | |
} | |
return $post; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment