Last active
January 28, 2021 03:44
-
-
Save jsdecena/8cb7e2e67d9c2fc5e56713912af3b0ed to your computer and use it in GitHub Desktop.
Articles Api Controller Class
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\Api; | |
use App\Articles\Article; | |
class ArticlesApiController extends Controller | |
{ | |
/** | |
* @param CreateArticleRequest $request | |
*/ | |
public function store(CreateArticleRequest $request) { | |
return response()->json(['data' => Article::create($request->all())], 201); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment