Skip to content

Instantly share code, notes, and snippets.

@jsdecena
Last active January 28, 2021 03:44
Show Gist options
  • Save jsdecena/8cb7e2e67d9c2fc5e56713912af3b0ed to your computer and use it in GitHub Desktop.
Save jsdecena/8cb7e2e67d9c2fc5e56713912af3b0ed to your computer and use it in GitHub Desktop.
Articles Api Controller Class
<?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