Skip to content

Instantly share code, notes, and snippets.

@jsdecena
Last active January 28, 2021 03:43
Show Gist options
  • Save jsdecena/a5e7a41dbc4c9cc575d8ff2cd51bc5d7 to your computer and use it in GitHub Desktop.
Save jsdecena/a5e7a41dbc4c9cc575d8ff2cd51bc5d7 to your computer and use it in GitHub Desktop.
Articles Api Controller Class
<?php
namespace App\Http\Controllers\Api;
class ArticlesApiController extends Controller
{
/**
* @param CreateArticleRequest $request
*/
public function store(CreateArticleRequest $request) {
return response()->json(['data' => Article::create($request->all())]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment