Created
March 14, 2018 01:41
-
-
Save jsdecena/fcb926a040eb76f630d498fd652020a5 to your computer and use it in GitHub Desktop.
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\Requests\CreateArticleRequest; | |
use App\Http\Controllers\Controller; | |
class ArticlesApiController extends Controller | |
{ | |
/** | |
* Store all the data request in the database | |
* | |
* @param CreateArticleRequest $request | |
* @return \Illuminate\Http\JsonResponse | |
*/ | |
public function store(CreateArticleRequest $request) | |
{ | |
$article = Article::create($request->all()); | |
return response()->json($article, 201); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment