app/Http/Controllers/Api/CustumerController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        try {
            $data = Custumer::get();
            return new DefaultResource([
                'message' => __("api.default_success_message"),
                'data' => $data
            ]);
        } catch (\Exception $error) {
            return (new DefaultErrorResource(['message' => $error->getMessage()]))->response()->setStatusCode(HttpStatusCodesUtils::INTERNAL_SERVER_ERROR);
        }
    }
public function index ( ) { try { $ data = Custumer :: get ( ) ; return new DefaultResource ( [ 'message' => __ ( " api.default_success_message " ) , 'data' => $ data ] ) ; } catch ( \ Exception $ error ) { return ( new DefaultErrorResource ( [ 'message' => $ error -> getMessage ( ) ] ) ) -> response ( ) -> setStatusCode ( HttpStatusCodesUtils :: INTERNAL_SERVER_ERROR ) ; } }
Display a listing of the resource.
Display a listing of the resource .
//Reposta JSON padrão para sucesso //Resposta JSON padrão para falhas