app/Http/Controllers/API/CompanyController.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)
    {
        $post = new posts();
        $post->title = $request->title;
        $post->body = $request->body;
        if ($post->save()) {
            return  $this->apiResponse('', 200);
        } else {
            return $this->apiResponse('', 'erro to stor post', 404);
        }
    }
public function store ( Request $ request ) { $ post = new posts ( ) ; $ post -> title = $ request -> title ; $ post -> body = $ request -> body ; if ( $ post -> save ( ) ) { return $ this -> apiResponse ( '' , 200 ) ; } else { return $ this -> apiResponse ( '' , 'erro to stor post' , 404 ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
// return response()->json(['status'=>'success']); //  return response()->json(['status'=>'error']);