Last active
September 6, 2017 10:12
-
-
Save developerdino/dfe3ff0f91e1e6d48df9205eb11412c9 to your computer and use it in GitHub Desktop.
Using Laravel 5.5 Resources to create your own {JSON:API} formatted API - Medium Gists
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
| <?php | |
| namespace App\Http\Controllers; | |
| use App\Article; | |
| class ArticleController extends Controller | |
| { | |
| /** | |
| * Display the specified resource. | |
| * | |
| * @param \App\Article $article | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function show(Article $article) | |
| { | |
| return $article->toArray(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment