app/Http/Controllers/ArticleController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $this->authorize('create', Article::class);
        $article = request()->user()->articles()->create($this->validateData());
        ArticleResource::withoutWrapping();
        return (new ArticleResource($article))->response()->setStatusCode(Response::HTTP_CREATED);
    }
public function store ( Request $ request ) { $ this -> authorize ( 'create' , Article :: class ) ; $ article = request ( ) -> user ( ) -> articles ( ) -> create ( $ this -> validateData ( ) ) ; ArticleResource :: withoutWrapping ( ) ; return ( new ArticleResource ( $ article ) ) -> response ( ) -> setStatusCode ( Response :: HTTP_CREATED ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .