This study investigates the application of physics-informed neural networks (PINNs) as alternative tofinite element (FE) solvers in both classical and gradient-enhanced solid mechanics. To this end, thePINN architecture is specifically designed to represent continuous solutions of boundary value problems within spatio-temporal space. The governing partial differential equations as well as the boundary conditions are incorporated via soft constraint terms in the objective function which is minimized during the training of the PINNs. As the differential and rate form of equilibrium and constitutiveequations are directly considered using the power of automatic differentiation, the need for traditionalincremental implementation is eliminated. This advantage allows the methodology to address complexproblems, such as gradient-enhanced plasticity theories, with practically no additional effort comparedto classical frameworks. The effectiveness of the proposed methodology is demonstrated via benchmarkproblems. Moreover, as neural networks are by design smooth functions, the classic PINNs cannot precisely approximate non-smooth solutions with localization or abrupt change in the slope. To address thisissue, enrichment patches based on wavelet functions are developed by the authors to enrich the smoothsolutions learned by the PINNs, allowing precise approximation of solutions presenting localization.