app/Http/Controllers/Api/CustumerController.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)
    {
        try {       
            return new DefaultResource([
                'message' => __("api.default_success_message"),
                'data' => "Listagem"
            ]);
        } catch (\Exception $error) {
            return (new DefaultErrorResource(['message' => $error->getMessage()]))->response()->setStatusCode(HttpStatusCodesUtils::INTERNAL_SERVER_ERROR);
        }
    }
public function store ( Request $ request ) { try { return new DefaultResource ( [ 'message' => __ ( " api.default_success_message " ) , 'data' => " Listagem " ] ) ; } catch ( \ Exception $ error ) { return ( new DefaultErrorResource ( [ 'message' => $ error -> getMessage ( ) ] ) ) -> response ( ) -> setStatusCode ( HttpStatusCodesUtils :: INTERNAL_SERVER_ERROR ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
//Reposta JSON padrão para sucesso //Resposta JSON padrão para falhas