1 Introduction

Cosmologists have recently revealed revolutionary discoveries that defy traditional beliefs regarding the spatial organization of celestial structures in our cosmos. Rather than presenting a random dispersion, these formations exhibit a discernible order, sparking significant curiosity among researchers. The meticulous study of these entities has become a central topic of exploration for scientists committed to unraveling the mystery surrounding the accelerated expansion of the universe. Empirical testimonies strongly indicate the existence of an extensive counter-force to gravitational attraction, driving the observed rapid expansion. Referred to as dark energy, this enigmatic force presents a significant puzzle for scientists. While Einstein’s general relativity (GR) provides some insights into this expansion, it encounters difficulties in fully explaining dark energy, particularly in relation to the cosmological constant \(\Lambda \). Therefore, it has been necessary to introduce modifications to the existing theory to better comprehend and enhance our knowledge regarding fundamental dynamics of the cosmos.

Einstein’s GR has straightforwardly been modified to \(f(\mathcal {R})\) gravity, representing a substantial advancement in experimental physics. This theory alters the action function by interchanging the curvature scalar \(\mathcal {R}\) and its general functional. Notable progress has been made within this gravity theory, with implications reaching into the study of celestial structures [1,2,3,4]. Astashenok with his collaborators [5] investigated the upper mass limit for massive objects in the current framework. Their research produced an intriguing result that as a second object in the binary GW190814, there must be either a rapidly rotating neutron star or a black hole. A significant body of literature underscores the remarkable contributions made by various researchers [6,7,8]. One notable contribution comes from Bertolami and his colleagues [9], who were instrumental in put forwarding the coupling between matter and spacetime geometry in \(f(\mathcal {R})\) gravity. Their methodology involved integrating the matter Lagrangian and \(\mathcal {R}\) into a unified functional form, known as \(f(\mathcal {R},\mathcal {L}_\textrm{m})\) theory. This novel concept prompted astronomers to focus on discussions related to the rapid universe’ expansion [10].

Following these developments, Harko et al. [11] introduced a ground-breaking gravitational theory, called \(f(\mathcal {R},\mathcal {T})\) gravity at the action level. This theory utilizes a generalized function that leads to a non-conserved phenomenon, resulting in the emergence of an extra force, causing moving particles to follow non-geodesic path [12]. Houndjo [13] employed a particular model based on the minimal interaction to explain the shift from one cosmic era to the other phase in which we are living right now. Among the various functional forms of \(f(\mathcal {R},\mathcal {T})\) theory, the \(\mathcal {R}+2\beta \mathcal {T}\) candidate has attracted considerable attention in scientific literature due to its ability to generate physically existing internal structures. Different researchers, including Das et al. [14], utilized a similar model to develop a three-layer gravastar geometry. Various methodologies were implemented to explore diverse geometrical structures in this context [15,16,17,18,19,20,21]. An essential facet of the \(f(\mathcal {R},\mathcal {T})\) gravity is its incorporation of some effects at quantum level, which introduces the potential for particle creation. This characteristic is of great significance in astronomical investigations as it sets out a connection between the extended theory and quantum mechanics. Notable findings in this area have been produced and can be seen in [22, 23]. In a recent research endeavor, Zaregonbadi et al. [24] have examined the feasibility of this modification to GR to study the impact of dark matter on clusters of galaxies.

The \(f(\mathcal {R},\mathcal {T})\) theory has indeed presented an intriguing extension to GR, showing a diverse range of phenomenology in modern research. However, researchers [25, 26] delved into the challenges associated with constructing a viable and realistic cosmology within this theory. Their study demonstrated that the currently discussed models of this theory do not yield an expandable cosmic background. In response to these challenges, Haghani and Harko [27] undertook a considerable effort by simultaneously unify two categories of gravitational theories, and call it the \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) gravity. This strategic approach aims to address the limitations encountered in the previously discussed gravity models and offers a more comprehensive understanding of the intricate dynamics governing the universe. They explored the Newtonian limit of the field equations and provided some terms representing an extra-acceleration, particularly focusing on scenarios involving small velocities of particles and weak fields of gravity. This exploration enlightens how different choices of Lagrangian influence the description of the cosmic expansion. Zubair et al. [28] reconstructed some cosmological solutions such as de Sitter and \(\Lambda \)CDM models in this theory and found them to be cosmologically stable through suitable perturbations.

The study of celestial entities characterized by the field equations possessing high non-linearity, either in the framework of GR or extended theories, has prompted astronomers to actively seek their numerical or exact solutions. The significance of compact interiors lies in the physical interest they hold, contingent upon the satisfaction of specific conditions by the developed model. Various methodologies have been engaged in the scientific literature to derive such solutions, including the utilization of a specific ansatz or the implementation of particular equations of state, among other techniques. One approach to solving this challenge is through the implementation of the embedding class-one phenomenon, which posits that one can embed any space in another having at least one higher dimension. Bhar et al. [29] employed the same method, coupled with particular metric potentials and derived physically existing anisotropic solutions. Maurya et al. [30, 31] used the same approach to construct a new solution, delving into its stability and exploring the impact of anisotropic pressure on relativistic systems. Singh with his collaborators [32] devised a singularity-free solution for spherical geometry by proposing a specific metric function within the framework of this technique. Exploring this condition into a matter-geometry coupled theory, several works have yielded stable as well as viable solutions [33,34,35,36,37].

In this paper, we explore various isotropic solutions in conjunction with the Maxwell field within the framework of \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) theory. The paper’s structure is organized as follows. The following section establishes some basics of this extended theory and derives the generalized field equations. Sect. 2 presents the Karmarkar condition, which aids in determining the metric potentials. Additionally, we utilize the Reissner-Nordström vacuum solution and compute the constants associated with the overhead condition. We outline particular criteria that, once fulfilled, guarantee the model’s physical validity in Sect. 3. Advancing further, Sect. 4 reveals the newly formulated solutions and offers a visual representation to aid in understanding the physical relevance of the obtained results. Conclusively, in the final section, our findings are encapsulated, summarizing the main outcomes and insights acquired in this study.

2 Fundamentals of modified theory

The action of the modified \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) theory is obtained after replacing the Ricci scalar with this functional [27]. This has the form

$$\begin{aligned} S=\int \sqrt{-g}\left[ \frac{f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})}{16\pi } +\mathcal {L}_{m}+\mathcal {L}_{\mathcal {E}}\right] d^{4}x, \end{aligned}$$
(1)

where the electric charge and ordinary matter have Lagrangian densities, denoted by \(\mathcal {L}_{\mathcal {E}}\) and \(\mathcal {L}_{m}\), respectively. Also, \(g=|g_{\epsilon \omega }|\) with \(g_{\epsilon \omega }\) being the metric tensor and the two lines enclosing it symbolize the determinant. Varying the action (1) w.r.t. \(g_{\epsilon \omega }\), the tensorial form of the modified field equations become

$$\begin{aligned} \mathcal {G}_{\epsilon \omega }=8\pi \mathcal {T}_{\epsilon \omega }^{(eff)}, \end{aligned}$$
(2)

where the entity \(\mathcal {G}_{\epsilon \omega }\), namely the Einstein tensor, expresses the geometry of the considered fluid distribution and \(\mathcal {T}_{\epsilon \omega }^{(eff)}\) refers to the matter enclosed by that geometry. This effective term is further classified into three different energy-momentum tensors as

$$\begin{aligned} \mathcal {T}_{\epsilon \omega }^{(eff)}=\frac{1}{f_{\mathcal {R}}}\left( \mathcal {T}^{(m)}_{\epsilon \omega } +\mathcal {E}_{\epsilon \omega }\right) +\mathcal {T}_{\epsilon \omega }^{(cr)}, \end{aligned}$$
(3)

where

  • \(\mathcal {T}^{(m)}_{\epsilon \omega }\) correspond to the ordinary matter configuration,

  • \(\mathcal {E}_{\epsilon \omega }\) indicates the presence of charge in the self-gravitating system,

  • \(\mathcal {T}^{(cr)}_{\epsilon \omega }\) are modified correction terms.

We express \(\mathcal {T}^{(m)}_{\epsilon \omega }\) as follows

$$\begin{aligned} \mathcal {T}_{\epsilon \omega }^{(m)}&=-\frac{2}{\sqrt{-g}}\left\{ \frac{\delta \left( \sqrt{-g}\mathcal {L}_{m}\right) }{\delta g^{\epsilon \omega }}\right\} \quad \Rightarrow \\ \mathcal {T}_{\epsilon \omega }^{(m)}&=g_{\epsilon \omega }\mathcal {L}_{m} -\frac{\partial \mathcal {L}_{m}}{\partial g_{\epsilon \omega }}. \end{aligned}$$

On the other hand, the last term on the right side of Eq. (3) have the value given by

$$\begin{aligned} \mathcal {T}_{\epsilon \omega }^{(cr)}&=\frac{1}{8\pi f_{\mathcal {R}}}\bigg [\frac{1}{2}\big (2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}\big )\mathcal {T}_{\epsilon \omega }^{(m)} -(g_{\epsilon \omega }\Box -\nabla _{\epsilon }\nabla _{\omega })f_{\mathcal {R}}\nonumber \\&\quad +\frac{1}{2}\big (f-\mathcal {R}f_{\mathcal {R}}\big )g_{\epsilon \omega } -\big (2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}\big )\mathcal {L}_{m}g_{\epsilon \omega }\nonumber \\&\quad +2f_{\mathcal {T}}g^{\zeta \beta }\frac{\partial ^2 \mathcal {L}_{m}}{\partial g^{\epsilon \omega }\partial g^{\zeta \beta }}\bigg ], \end{aligned}$$
(4)

where \(f_{\mathcal {T}}=\frac{\partial f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})}{\partial \mathcal {T}}\), \(f_{\mathcal {L}_{m}}=\frac{\partial f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})}{\partial \mathcal {L}_{m}}\) and \(f_{\mathcal {R}}=\frac{\partial f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})}{\partial \mathcal {R}}\). The mathematical definitions of the D’Alembertian operator and covariant derivative are \(\Box \equiv (-g)^{\frac{-1}{2}}\partial _\epsilon \big (\sqrt{-g}g^{\epsilon \omega }\partial _{\omega }\big )\) and \(\nabla _\epsilon f_{\mathcal {R}}=f_{\mathcal {R},\epsilon }-\Gamma ^{\omega }_{\epsilon \omega }f_{\mathcal {R}}\), respectively. Equations (2)–(4) provides after combining as

$$\begin{aligned} \mathcal {G}_{\epsilon \omega }&=\frac{1}{f_{\mathcal {R}}}\bigg [\big \{8\pi +\frac{1}{2}\big (2f_{\mathcal {T}} +f_{\mathcal {L}_{m}}\big )\big \}\mathcal {T}_{\epsilon \omega }^{(m)}+8\pi \mathcal {E}_{\epsilon \omega }\nonumber \\&\quad -(g_{\epsilon \omega }\Box -\nabla _{\epsilon }\nabla _{\omega })f_{\mathcal {R}} +\frac{1}{2}\big (f-\mathcal {R}f_{\mathcal {R}}\big )g_{\epsilon \omega } \nonumber \\&\quad -\big (2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}\big )\mathcal {L}_{m}g_{\epsilon \omega } +2f_{\mathcal {T}}g^{\zeta \beta }\frac{\partial ^2 \mathcal {L}_{m}}{\partial g^{\epsilon \omega }\partial g^{\zeta \beta }}\bigg ]. \end{aligned}$$
(5)

The energy-momentum tensor plays a pivotal role in formulating the gravitational field equations, enabling a precise representation of the interaction between matter and spacetime curvature. This tensor proves indispensable in understanding a wide array of physical phenomena, from celestial bodies’ gravitational influences to the dynamics of fluid systems. Its incorporation not only facilitates the development of accurate models for diverse astrophysical scenarios but also contributes to the exploration of fundamental principles in the broader context. The models possessing the isotropic fluid among all existing in the literature holds significance. Its application proves instrumental in various scientific disciplines, contributing to the development of accurate and tractable models for the study of diverse physical processes. Such matter distributions can be defined in the following way [38]

$$\begin{aligned} \mathcal {T}_{\epsilon \omega }^{(m)}=\rho \mathcal {V}_{\epsilon }\mathcal {V}_{\omega } +\big (\mathcal {V}_{\epsilon }\mathcal {V}_{\omega }+g_{\epsilon \omega }\big )P, \end{aligned}$$
(6)

where P being the pressure, \(\rho \) symbolizes the energy density and \(\mathcal {V}_{\epsilon }\) indicates the four-velocity. The stress-energy tensor expressing the electromagnetic field is defined by [39]

$$\begin{aligned} \mathcal {E}_{\epsilon \omega }=\frac{1}{4\pi }\left[ \frac{1}{4}g_{\epsilon \omega }\mathcal {W}^{\alpha \eta }\mathcal {W}_{\alpha \eta } -\mathcal {W}^{\eta }_{\epsilon }\mathcal {W}_{\eta \omega }\right] , \end{aligned}$$

whereas we can write Maxwell equations in concise (or tensorial) form as

$$\begin{aligned} \mathcal {W}^{\epsilon \omega }_{;\omega }=4\pi \varepsilon ^{\epsilon }, \quad \mathcal {W}_{[\epsilon \omega ;\eta ]}=0. \end{aligned}$$
(7)

Here, \(\mathcal {W}_{\epsilon \omega }=\varphi _{\omega ;\epsilon }-\varphi _{\epsilon ;\omega }\) is written in terms of the four potential defined by \(\psi _{\omega }=\psi (r)\delta ^{0}_{\omega }\). Also, the current \(\varepsilon ^{\epsilon }\) and charge density \(\varpi \) are combined with each other through the relation \(\varepsilon ^{\epsilon }=\varpi \mathcal {V}^{\epsilon }\).

Determining the trace of Eq. (5), we have the following

$$\begin{aligned}&2\big \{f-\big (2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}\big )\mathcal {L}_{m}\big \} +\mathcal {T}\left( f_\mathcal {T}+8\pi +\frac{1}{2}f_{\mathcal {L}_{m}}\right) \\&\quad -3\Box f_{\mathcal {R}}-\mathcal {R}f_\mathcal {R} +2f_\mathcal {T}g^{\zeta \beta }g^{\epsilon \omega } \frac{\partial ^2\mathcal {L}_{m}}{\partial g^{\zeta \beta }\partial g^{\epsilon \omega }}=0. \end{aligned}$$

As functional of this theory is generalized in terms of the geometry and matter terms, the divergence of the stress-energy tensor becomes non-null. As a result, a supplementary force emerges within the gravitational field of a massive object, leading to modifications in the geodesic trajectory of moving test particles. This force is mathematically expressed as follows

$$\begin{aligned} \nabla ^\epsilon \mathcal {T}_{\epsilon \omega }^{(m)}&=\frac{1}{16\pi +2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}} \bigg [\nabla _\omega \big \{\big (2f_\mathcal {T}+f_{\mathcal {L}_{m}}\big )\mathcal {L}_{m}\big \}\nonumber \\&\quad -\mathcal {T}_{\epsilon \omega }^{(m)}\nabla ^\epsilon \big (2f_\mathcal {T}+f_{\mathcal {L}_{m}}\big ) -\big (f_{\mathcal {T}}\nabla _\omega \mathcal {T}+f_{\mathcal {L}_{m}}\nabla _\omega \mathcal {L}_{m}\big )\nonumber \\&\quad -8\pi \nabla ^\epsilon \mathcal {E}_{\epsilon \omega } -4g^{\zeta \beta }\nabla ^\epsilon \left( f_{\mathcal {T}} \frac{\partial ^2\mathcal {L}_{m}}{\partial g^{\epsilon \omega }\partial g^{\zeta \beta }}\right) \bigg ]. \end{aligned}$$
(8)

Considering a spherical spacetime as an interior geometry is a significant starting point as its investigation involves understanding the curvature dynamics and gravitational interactions specific to a spherical space. The following metric represents such geometry as

$$\begin{aligned} ds^2=-e^{\varrho _1(r)} dt^2+e^{\varrho _2(r)} dr^2+r^2\big (d\theta ^2+\sin ^2\theta d\phi ^2\big ), \end{aligned}$$
(9)

where radial/temporal components depend only on the radial coordinate, showing that the geometry under consideration is static. We observe the presence of the four-vector in Eq. (6) which now becomes

$$\begin{aligned} \mathcal {V}_\epsilon =-\delta ^0_\epsilon e^{\frac{\varrho _1}{2}}=(-e^{\frac{\varrho _1}{2}},0,0,0). \end{aligned}$$
(10)

Equation (7) (left) along with the metric (9) yields

$$\begin{aligned} \psi ''+\frac{1}{2r}\big [4-r(\varrho _1'+\varrho _2')\big ]\psi '=4\pi \varpi e^{\frac{\varrho _1}{2}+\varrho _2}, \end{aligned}$$

where \('=\frac{\partial }{\partial r}\). Implementing an integration on the above second-order equation results in the following expression

$$\begin{aligned} \psi '=\frac{s}{r^2}e^{\frac{\varrho _1+\varrho _2}{2}}, \end{aligned}$$

where the total interior charge is defined as \(s\equiv s(r)=\int _{0}^{r}\varpi e^{\frac{\varrho _2}{2}}\bar{r}^2d\bar{r}\).

The isotropic modified field equations representing spherical structure are now formulated by combining Eqs. (5), (6) and (9). The non-vanishing components are given by

$$\begin{aligned}&e^{-\varrho _2}\left( \frac{\varrho _2'}{r}-\frac{1}{r^2}\right) +\frac{1}{r^2}\nonumber \\&\quad =\frac{1}{f_{\mathcal {R}}}\bigg [\big \{8\pi +\frac{1}{2}\big (2f_{\mathcal {T}} +f_{\mathcal {L}_{m}}\big )\big \}\rho +(\Box -\nabla ^{0}\nabla _{0})f_{\mathcal {R}}\nonumber \\&\qquad +\frac{s^2}{r^4}-\frac{1}{2}\big (f-\mathcal {R}f_{\mathcal {R}}\big ) +\big (2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}\big )\mathcal {L}_{m}\bigg ], \end{aligned}$$
(11)
$$\begin{aligned}&e^{-\varrho _2}\left( \frac{1}{r^2}+\frac{\varrho _1'}{r}\right) -\frac{1}{r^2}\nonumber \\&\quad =\frac{1}{f_{\mathcal {R}}}\bigg [\big \{8\pi +\frac{1}{2}\big (2f_{\mathcal {T}} +f_{\mathcal {L}_{m}}\big )\big \}P -(\Box -\nabla ^{1}\nabla _{1})f_{\mathcal {R}} \nonumber \\&\qquad -\frac{s^2}{r^4}+\frac{1}{2}\big (f-\mathcal {R}f_{\mathcal {R}}\big ) -\big (2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}\big )\mathcal {L}_{m}\bigg ], \end{aligned}$$
(12)
$$\begin{aligned}&\frac{e^{-\varrho _2}}{4}\left[ \varrho _1'^2-\varrho _2'\varrho _1'+2\varrho _1''-\frac{2\varrho _2'}{r}+\frac{2\varrho _1'}{r}\right] \nonumber \\&\quad =\frac{1}{f_{\mathcal {R}}}\bigg [\big \{8\pi +\frac{1}{2}\big (2f_{\mathcal {T}} +f_{\mathcal {L}_{m}}\big )\big \}P+\frac{s^2}{r^4} -(\Box -\nabla ^{1}\nabla _{1})f_{\mathcal {R}}\nonumber \\&\qquad +\frac{1}{2}\big (f-\mathcal {R}f_{\mathcal {R}}\big ) -\big (2f_{\mathcal {T}}+f_{\mathcal {L}_{m}}\big )\mathcal {L}_{m}\bigg ]. \end{aligned}$$
(13)

Also, the terms \(\mathcal {T}\) and \(\mathcal {R}\) are defined as

$$\begin{aligned} \mathcal {T}&=-\rho +3P,\\ \mathcal {R}&=e^{-\varrho _2}\left[ \varrho _1''+2(1-e^{\varrho _2})+\frac{\varrho _1'^2}{2}{-}\frac{\varrho _1'\varrho _2'}{2} {+}\frac{2(\varrho _1'-\varrho _2')}{r}\right] . \end{aligned}$$

Solving Eqs. (11)–(13) presents a complex challenge due to the intricate relationships among multiple quantities, including \((\varrho _1, \varrho _2, \rho , P, q)\). To address this complexity and arrive at a definitive solution, it is essential to introduce specific constraints. Without these constraints, obtaining a unique solution proves to be an insurmountable task.

2.1 Embedding class-one condition and smooth matching of interior and exterior spacetimes

The incorporation of embedding class-one condition is crucial in discussing compact stars as they provide essential constraints and insights into the equilibrium and stability of these astrophysical objects. This mathematical condition contribute to a more comprehensive understanding of the physical properties governing celestial systems, aiding researchers in formulating accurate models and predictions for their behavior in extreme environments. According to this, if a tensor \(\mathcal {Q}_{\epsilon \omega }\) possessing the property of being symmetry fulfills the Gauss–Codazzi equations given in the following

$$\begin{aligned} \mathcal {R}_{\epsilon \omega \alpha \eta }=2\textbf{p}\mathcal {Q}_{\epsilon [\alpha }\mathcal {Q}_{\eta ]\omega }, \ \mathcal {Q}_{\epsilon [\omega ;\alpha ]}-\Gamma ^\eta _{\omega \alpha }\mathcal {Q}_{\epsilon \eta } +\Gamma ^\eta _{\epsilon [\omega }\mathcal {Q}_{\alpha ]\eta }=0, \end{aligned}$$
(14)

then an \((n-2)\)-dimensional space can be embedded into the space of \((n-1)\)-dimension. Here, \(\mathcal {Q}_{\omega \epsilon }\) and \(\mathcal {R}_{\epsilon \omega \alpha \eta }\) symbolize the coefficients of second differential form and the curvature tensor, respectively, and \(\textbf{p}=\pm 1\). The above left equation, known as the Gauss equation, characterizes the intrinsic geometry of the surface by relating its curvature to that of the ambient space. This equation is crucial for understanding how the surface curves within the space it is embedded. On the other hand, the Codazzi–Mainardi (or Codazzi) equation given on the right side, expresses the compatibility between the intrinsic and extrinsic geometry of the surface. Mathematically, this condition can be written as follows [40]

$$\begin{aligned} \mathcal {R}_{2323}\mathcal {R}_{0101}-\mathcal {R}_{0303}\mathcal {R}_{1212}-\mathcal {R}_{1303}\mathcal {R}_{1202}=0, \end{aligned}$$
(15)

resulting in the second-order differential equation after merging with the metric (9) as

$$\begin{aligned} \big (\varrho _2'-\varrho _1'\big )\varrho _1'e^{\varrho _2}+2\big (1-e^{\varrho _2}\big )\varrho _1''+\varrho _1'^2=0, \end{aligned}$$
(16)

that provides one component, say radial, in terms of the temporal coefficient. This takes the form

$$\begin{aligned} \varrho _2(r)=\ln \big (1+b_1\varrho _1'^2e^{\varrho _1}\big ), \end{aligned}$$
(17)

involving \(b_1\) as an integration constant. To calculate the \(g_{rr}\) component accurately, it is essential to adopt the temporal coefficient. For this, we refer to widely recognized \(g_{tt}\) component within the astrophysics research community [30, 31]. This is taken by

$$\begin{aligned} \varrho _1(r)=2b_2r^2+\ln b_3, \end{aligned}$$
(18)

possessing two positive constants, denoted as \(b_2\) and \(b_3\), the values of which remain unspecified yet. Lake [41] introduced a criterion to assess the physical relevance of the metric potentials under consideration. By applying this evaluation to the specific component (18), it is determined whether such component holds significance in the context of the study. Therefore, we have

$$\begin{aligned} \varrho _1'(r)=4b_2r, \quad \varrho _1''(r)=4b_2. \end{aligned}$$

We notice that \(\varrho _1(r)=\ln b_3,~\varrho _1'(r)=0\) and \(\varrho _1''(r)>0\) at \(r=0\), representing the star’s center. This validates the suitability of Eq. (18). Upon insertion into Eq. (17), the function \(\varrho _2(r)\) assumes the following value

$$\begin{aligned} \varrho _2(r)=\ln \big (1+b_2b_4r^2e^{2b_2r^2}\big ), \end{aligned}$$
(19)

where \(b_4=16b_1b_2b_3\).

By enforcing consistency at the boundary of the object, junction conditions enable a smooth transition between different regions of spacetime, preserving the physical integrity of the model. This is crucial for accurately representing the gravitational field both inside and outside the compact object, contributing to a more realistic understanding of its structure and gravitational effects. Since a charged interior sphere (9) is considered, it must be adopted the Reissner-Nordström metric as an exterior spacetime. With \(\mathcal {S}\) and \(\mathcal {M}\) as the total charge and mass, this metric is given as follows

$$\begin{aligned} ds^2= & {} -\left( 1-\frac{2\mathcal {M}}{\textrm{R}}+\frac{\mathcal {S}^2}{\textrm{R}^2}\right) dt^2 +\left( 1-\frac{2\mathcal {M}}{\textrm{R}}+\frac{\mathcal {S}^2}{\textrm{R}^2}\right) ^{-1}dr^2\nonumber \\{} & {} +r^2\big (d\theta ^2+\sin ^2\theta d\phi ^2\big ). \end{aligned}$$
(20)

It must be stressed here that the first fundamental forms equals the radial as well as temporal components of both of the exterior and interior spacetime at the surface boundary, say mathematically \(\Sigma : r=\textrm{R}\). This is also true for the term \(g_{tt,r}\). Following this, we have

$$\begin{aligned}&g_{tt}{_=^\Sigma }e^{\varrho _1(\textrm{R})}=b_3e^{2b_2\textrm{R}^2}=1-\frac{2\mathcal {M}}{\textrm{R}} +\frac{\mathcal {S}^2}{\textrm{R}^2}, \end{aligned}$$
(21)
$$\begin{aligned}&g_{rr}{_=^\Sigma }e^{\varrho _2(\textrm{R})}=1+b_2b_4\textrm{R}^2e^{2b_2\textrm{R}^2} =\bigg (1-\frac{2\mathcal {M}}{\textrm{R}}+\frac{\mathcal {S}^2}{\textrm{R}^2}\bigg )^{-1},\end{aligned}$$
(22)
$$\begin{aligned}&\frac{\partial g_{tt}}{\partial r}{_=^\Sigma }\varrho _1'(\textrm{R})=4b_2\textrm{R}=\frac{2\mathcal {M}\textrm{R}-2\mathcal {S}^2}{\textrm{R}\big (\textrm{R}^2-2\mathcal {M}\textrm{R}+\mathcal {S}^2\big )}. \end{aligned}$$
(23)

The quartet (\(b_1,b_2,b_3,b_4\)) can now be easily found by simultaneously solving Eqs. (21)–(23). Their values are

$$\begin{aligned} b_1= & {} \frac{\textrm{R}^4\big (2\mathcal {M}\textrm{R}-\mathcal {S}^2\big )}{4\big (\mathcal {M}\textrm{R}-\mathcal {S}^2)^2},\end{aligned}$$
(24)
$$\begin{aligned} b_2= & {} \frac{\mathcal {M}\textrm{R}-\mathcal {S}^2}{2\textrm{R}^2\big (\textrm{R}^2 -2\mathcal {M}\textrm{R}+\mathcal {S}^2\big )},\end{aligned}$$
(25)
$$\begin{aligned} b_3= & {} \bigg (\frac{\textrm{R}^2-2\mathcal {M}\textrm{R}+\mathcal {S}^2}{\textrm{R}^2}\bigg ) e^{\frac{\mathcal {M}\textrm{R}-\mathcal {S}^2}{2\mathcal {M}\textrm{R}-\textrm{R}^2-\mathcal {S}^2}},\end{aligned}$$
(26)
$$\begin{aligned} b_4= & {} \frac{2\big (2\mathcal {M}\textrm{R}-\mathcal {S}^2\big )}{\mathcal {M}\textrm{R}-\mathcal {S}^2} e^{\frac{\mathcal {M}\textrm{R}-\mathcal {S}^2}{2\mathcal {M}\textrm{R}-\textrm{R}^2-\mathcal {S}^2}}. \end{aligned}$$
(27)

Determining the dimension of these constants is significant in such analysis of the compact stars. We find that the constant \(b_1\) has a dimension of \(\ell ^2\) and \(b_2\) having \(\frac{1}{\ell ^2}\). However, the other constants, i.e., \(b_3\) and \(b_4\) have null dimensions. The graphical interpretation of the solutions (which shall be obtained later) needs some definite values of these constants. In order to make this possible, a star LMC X-4 is considered along with its observed data [42]. In the following, the numerical values of these four constants are calculated in Tables 1 and 2 for multiple stars by choosing the exterior charge as 0.2 and 0.8, respectively with \({\textbf {M}}_{\bigodot }\) being the mass of the Sun.

Table 1 Values of embedding class-one constants (\(b_1,b_2,b_3,b_4\)) for \(\mathcal {S}=0.2\)
Table 2 Values of embedding class-one constants (\(b_1,b_2,b_3,b_4\)) for \(\mathcal {S}=0.8\)

The relation between the values of \(b_1,~b_3,~b_4\) and the electric charge is evident, as an increase in the later term is directly associated with the variations in these three constants. However, the value of \(b_2\) is decreased as the electric charge is increased.

3 Physical requirements admitting by Stellar models

In this section, we review multiple conditions that have been discussed in the literature whose satisfaction leads to the compact interior models to be physically relevant [43,44,45,46,47,48]. We highlight some interesting and necessary conditions among them that must be discussed while studying the stars in the following.

  • A critical aspect involves the investigation of geometric quantities such as \(e^{\varrho _1}\) and \(e^{\varrho _2}\). It must be verified that both these components are positive to maintain physical significance. Additionally, the regularity of these functions should be confirmed within the defined physical domain, ensuring they do not exhibit singularities.

  • Within compact stars, the behavior of energy density and pressure, along with their first two derivatives, is critical in understanding the internal configuration of these astrophysical objects. Typically, as one moves from the stellar surface towards the center, both these parameters tend to increase, reaching their maximum values at the core. The first derivatives with respect to radial distance capture the rate of change of these quantities, highlighting the distribution of mass and the response of matter to gravitational forces.

  • A point of discussion among researchers is the mass function that describes the fluid content enclosed by a body. This helps in understanding the gravitational impact of that structure. We express this in the form of energy density as

    $$\begin{aligned} m(r)=\frac{1}{2}\int _{0}^{\textrm{R}}\bar{r}^2\rho d\bar{r}. \end{aligned}$$
    (28)

    The strength of a field surrounding a self-gravitating structure due to its gravity in relation with its size is measured by the compactness. It is actually a ratio between the mass of a body and its radius. Its expression is given by

    $$\begin{aligned} \lambda (r)=\frac{m(r)}{r}, \end{aligned}$$
    (29)

    which must be less than \(\frac{4}{9}\) to get a physically relevant interior [49]. The redshift characterizes the extent to which photons are stretched as they climb out of the gravitational well of a compact star. We describe it as

    $$\begin{aligned} {\textbf {z}}(r)=\frac{1-\sqrt{1-2\lambda (r)}}{\sqrt{1-2\lambda (r)}}. \end{aligned}$$
    (30)

    It has been found that the redshift at the surface boundary must not be higher than 2 [49], i.e., \({\textbf {z}}_{\Sigma } \le 2\). On the other hand, when Ivanov dealt with anisotropic pressure fluid, he established this limit to be 5.211 [50].

  • The incorporation of energy conditions holds paramount significance in discussions about compact stars. These conditions play a pivotal role in constraining the matter distribution within these dense astrophysical objects. By imposing constraints on energy density and pressure, energy conditions ensure the physical viability of solutions, guiding the development of realistic models for self-gravitating structures. Upholding these conditions not only fosters mathematical consistency but also provides crucial insights into the nature of matter supporting these stellar objects. For the case of charged fluid, they have the form

    $$\begin{aligned}{} & {} \rho +P \ge 0, \quad \rho -P+\frac{s^2}{4\pi r^4} \ge 0, \\{} & {} \rho +3P +\frac{s^2}{4\pi r^4} \ge 0. \end{aligned}$$
  • Various approaches have been proposed to assess the stability of celestial systems, with one method involving the consideration of the causality condition derived from the sound speed, expressed as \(v_{s}^{2}=\frac{dP}{d\rho }\). According to Abreu et al. [51], this condition ensures that information within the stellar medium propagates at speeds less than the speed of light, preventing causality violations, i.e., \(0< v_{s}^{2} < 1\). At the same time, one can check the stability by studying the thermodynamic behavior of the celestial object. This can be discussed through the adiabatic index, indicated by \(\Gamma _{ai}\), whose formula is given as follows

    $$\begin{aligned} \Gamma _{ai}=\frac{\rho +P}{P}\left( \frac{dP}{d\rho }\right) . \end{aligned}$$

    To maintain the equilibrium of a compact model, the outward pressure must be as enough as it can counterbalance the force of gravity acting inward. This can only be achieved if the adiabatic index gain its value greater than \(\frac{4}{3}\) everywhere [52].

4 Brief discussion on two different \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) models

In this section, we obtain different solutions and perform a comprehensive analysis on their physical properties corresponding to two distinct models of the considered modified gravitational theory. We further extend our exploration by choosing two different forms of the matter Lagrangian density, one in terms of the energy density and other in the form of an isotropic pressure. A large body of literature guarantees the formation of acceptable solutions for both these choices. Now, we discuss them one by one in the following.

4.1 Model I

Two different \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) models have been extensively discussed along with their cosmological implications by Haghani and Harko [27]. The major difference between these models is that one is based on the minimal fluid-geometry interaction and the other model contains product terms, representing non-minimal coupling. We, firstly, consider a minimal interaction model as it is much easy to handle the corresponding calculations due to the appearance of linear-order fluid variables. This model, containing a triplet (\(\beta _0,\beta _1,\beta _2\)) of real-valued parameters, has the form

$$\begin{aligned} f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})= \mathcal {R}+\beta _0f_1(\mathcal {R})+2\beta _1 f_2(\mathcal {L}_{m})+\beta _2 f_3(\mathcal {T}), \end{aligned}$$
(31)

whose linear, and hence, simplified form is written as

$$\begin{aligned} f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})= \mathcal {R}+2\beta _1\mathcal {L}_{m}+\beta _2\mathcal {T}. \end{aligned}$$
(32)

4.1.1 Stellar solution for \(\mathcal {L}_{m}=P\)

In this case, we adopt the Lagrangian density to be \(\mathcal {L}_{m}=P\). The above model along with this choice and the field equations (11)–(13) provide

$$\begin{aligned}&e^{-\varrho _2}\left( \frac{\varrho _2'}{r}-\frac{1}{r^2}\right) +\frac{1}{r^2}\nonumber \\&\quad =\left( 8\pi +\beta _1+\beta _2\right) \rho +\frac{s^2}{r^4}-\beta _2\left( P-\frac{\rho }{2}\right) , \end{aligned}$$
(33)
$$\begin{aligned}&e^{-\varrho _2}\left( \frac{1}{r^2}+\frac{\varrho _1'}{r}\right) -\frac{1}{r^2}\nonumber \\&\quad =\left( 8\pi +\beta _1+\beta _2\right) P-\frac{s^2}{r^4}+\beta _2\left( P-\frac{\rho }{2}\right) , \end{aligned}$$
(34)
$$\begin{aligned}&\frac{e^{-\varrho _2}}{4}\left[ \varrho _1'^2-\varrho _2'\varrho _1'+2\varrho _1''-\frac{2\varrho _2'}{r}+\frac{2\varrho _1'}{r}\right] \nonumber \\&\quad =\left( 8\pi +\beta _1+\beta _2\right) P+\frac{s^2}{r^4}+\beta _2\left( P-\frac{\rho }{2}\right) . \end{aligned}$$
(35)

Since we have three equations in three unknowns (two fluid parameters and the charge), it is easy enough to calculate their explicit expressions and then merge them with Eqs. (18) and (19). This manipulation gives

$$\begin{aligned} \rho&=\frac{b_2}{\big (b_2 b_4 r^2 e^{2 b_2 r^2}{+}1\big )^2\big \{5 \beta _2 ^2{+}7 \beta _2 \beta _1 {+}8 \pi (7 \beta _2 {+}4 \beta _1 ){+}2 \beta _1 ^2{+}128 \pi ^2\big \}}\nonumber \\&\quad \times \big [8 \beta _2 +b_2 r^2 \big \{b_4^2 (\beta _2 +\beta _1 +8 \pi ) e^{4 b_2 r^2}-4 (\beta _2+\beta _1 +8 \pi )\nonumber \\&\quad +4 b_4 e^{2 b_2 r^2} (7 \beta _2 +3 \beta _1 +24 \pi )\big \}{+}2 b_4 (5 \beta _2 {+}3 \beta _1 +24 \pi ) e^{2 b_2 r^2}\big ], \end{aligned}$$
(36)
$$\begin{aligned} P&=\frac{-b_2}{\big (b_2 b_4 r^2 e^{2 b_2 r^2}{+}1\big )^2\big \{5 \beta _2 ^2{+}7 \beta _2 \beta _1 {+}8 \pi (7 \beta _2 {+}4 \beta _1 ){+}2 \beta _1 ^2{+}128 \pi ^2\big \}}\nonumber \\&\quad \times \big [b_2 r^2 \big \{b_4^2 (\beta _2 +\beta _1 +8 \pi ) e^{4 b_2 r^2}-4 (\beta _2 +\beta _1 +8 \pi )\nonumber \\&\quad -4 b_4 e^{2 b_2 r^2} (3 \beta _2 +\beta _1 +8 \pi )\big \}+2 \big \{(\beta _1 +8 \pi ) b_4 e^{2 b_2 r^2}\nonumber \\&\quad -2 (3 \beta _2 +2 \beta _1 +16 \pi )\big \}\big ], \end{aligned}$$
(37)
$$\begin{aligned} s&=\frac{b_2 r^3 \big (b_4 e^{2 b_2 r^2}-2\big )}{\sqrt{2} \big (b_2 b_4 r^2 e^{2 b_2 r^2}+1\big )} . \end{aligned}$$
(38)

4.1.2 Stellar solution for \(\mathcal {L}_{m}=-\rho \)

The field equations are now calculated for the other choice as \(\mathcal {L}_{m}=-\rho \). When we join this with Eqs. (11)–(13) and (32), this results in

$$\begin{aligned}&e^{-\varrho _2}\left( \frac{\varrho _2'}{r}-\frac{1}{r^2}\right) +\frac{1}{r^2}\nonumber \\&\quad =\left( 8\pi +\beta _1+\beta _2\right) \rho +\frac{s^2}{r^4} -\frac{\beta _2}{2}\left( 3P+\rho \right) , \end{aligned}$$
(39)
$$\begin{aligned}&e^{-\varrho _2}\left( \frac{1}{r^2}+\frac{\varrho _1'}{r}\right) -\frac{1}{r^2} \nonumber \\&\quad =\left( 8\pi +\beta _1+\beta _2\right) P-\frac{s^2}{r^4} +\frac{\beta _2}{2}\left( 3P+\rho \right) , \end{aligned}$$
(40)
$$\begin{aligned}&\frac{e^{-\varrho _2}}{4}\left[ \varrho _1'^2-\varrho _2'\varrho _1'+2\varrho _1''-\frac{2\varrho _2'}{r}+\frac{2\varrho _1'}{r}\right] \nonumber \\&\quad =\left( 8\pi +\beta _1+\beta _2\right) P +\frac{s^2}{r^4}+\frac{\beta _2}{2}\left( 3P+\rho \right) . \end{aligned}$$
(41)

The isotropic fluid parameters can explicitly be obtained by using only Eqs. (39) and (40). Using them with components (18) and (19) leads to

$$\begin{aligned} \rho&=\frac{b_2}{2\big (b_2 b_4 r^2 e^{2 b_2 r^2}{+}1\big )^2\big \{2 \beta _2 ^2{+}3 \beta _2 \beta _1 {+}8 \pi \big (3 \beta _2 {+}2 \beta _1 \big ){+}\beta _1 ^2{+}64 \pi ^2\big \}}\nonumber \\&\quad \times \big [b_2 r^2 \big \{b_4^2 (\beta _2 +\beta _1 +8 \pi ) e^{4 b_2 r^2}-4 (\beta _2 +\beta _1 +8 \pi )\nonumber \\&\quad +12 b_4 e^{2 b_2 r^2}\times (3 \beta _2 +\beta _1 +8 \pi ) \big \}\nonumber \\&\quad +6 \big \{2 \beta _2 +b_4 (2 \beta _2 +\beta _1 +8 \pi ) e^{2 b_2 r^2}\big \}\big ], \end{aligned}$$
(42)
$$\begin{aligned} P&=\frac{-b_2}{2 \big (\beta _2 +\beta _1 +8 \pi \big ) \big (2 \beta _2 +\beta _1 +8 \pi \big )\big (b_2 b_4 r^2 e^{2 b_2 r^2}+1\big )^2}\nonumber \\&\quad \times \big [b_2 r^2 \big \{b_4^2 (\beta _2 +\beta _1 +8 \pi ) e^{4 b_2 r^2}-4 (\beta _2 +\beta _1 +8 \pi )\nonumber \\&\quad -4 b_4e^{2 b_2 r^2} (\beta _1-\beta _2 +8 \pi ) \big \}+2 \big \{b_4 (2 \beta _2 +\beta _1 +8 \pi ) e^{2 b_2 r^2}\nonumber \\&\quad -2 (\beta _2 +2 \beta _1 +16 \pi )\big \}\big ]. \end{aligned}$$
(43)

When we solve Eqs. (40) and (41), the value of the charge is found to be the same that is already provided in (38).

We now perform a graphical check to explore the physical relevancy of the obtained minimally coupled solutions. For this, we plot several physical properties (that have been discussed earlier) which are basically the requirements to be fulfilled. Since there are two parameters involved in the considered modified model along with charge, we adopt their numerical values or ranges to analyze the impact on the stellar models as \(\beta _2=0.1,~0.8\), \(\mathcal {S}=0.3\) and \(\beta _1 \in [0.1,2]\). The question arises here is why we choose these particular values of the model parameters? Haghani and Harko [27] performed a comprehensive analysis in the context of model I and built some cosmological solutions, i.e., radiation dominated and dust universe. They used different combinations of parametric values such as both positive, both negative or alternative choices, etc. From this, they deduced that the non-negative values of both these parameters provide a best fit with the observational data. So, we initially choose both values and observe that only positive values of \(\beta _2\) yield promising results. For instance, its negative choices produce negative radial pressure near the spherical junction, which is in contrast with the requirement of physically existing compact stellar structures.

We confirm the behavior of potentials (18) and (19), and found them in agreement with the needed criterion. However, we do not add their plots here. Further, the exploration of the fluid sector (such as isotropic pressure and energy density in this case) is also performed through plotting the corresponding variables in Figs. 1 and 2. We notice their required behavior everywhere from the center of a compact star to its boundary surface. From these plotting, we also observe that when the parameters \(\beta _1\) and \(\beta _2\) increase, both the fluid parameters gain less values. This implies that the higher, the values of these parameters, the less dense, the interiors are. The isotropic pressure needs to be null at the spherical interface which is also ensured for each case.

There exist two approaches to calculate the interior mass of any self-gravitating fluid distribution, one in terms of the geometry and other in the form of matter. The former approach is failed to analyze how the modified theory affects the interior mass, therefore, we are left with the later choice (28). We plot this in Fig. 3 and find it to be a rising function of r. When the parameters \(\beta _1\) and \(\beta _2\) take smaller values, we get the structures with higher mass. Two other factors are also shown in the same Figure, indicating themselves consistent with the required behavior. Figures 4 and 5 admit the positive behavior of energy bounds, naming the developed models as physically viable structures. Finally, both the causality and thermodynamic variations are observed in Figs. 6 and 7, indicating the stability of the obtained modified stellar solutions.

Fig. 1
figure 1

Energy density and pressure for model I with \(\mathcal {L}_{m}=P\)

Fig. 2
figure 2

Energy density and pressure for model I with \(\mathcal {L}_{m}=-\rho \)

Fig. 3
figure 3

Physical factors for model I with \(\mathcal {L}_{m}=P\) (left) and \(-\rho \) (right)

Fig. 4
figure 4

Energy conditions for model I with \(\mathcal {L}_{m}=P\)

Fig. 5
figure 5

Energy conditions for model I with \(\mathcal {L}_{m}=-\rho \)

Fig. 6
figure 6

Stability analysis for model I with \(\mathcal {L}_{m}=P\)

Fig. 7
figure 7

Stability analysis for model I with \(\mathcal {L}_{m}=-\rho \)

4.2 Model II

This subsection discusses the dynamics of a spherically symmetric interior by adopting a strong non-minimal model of \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) gravity that is given in the following

$$\begin{aligned} f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})= \mathcal {R}+\delta _0f_1(\mathcal {R})+\delta _1 f_2(\mathcal {L}_{m},\mathcal {T}), \end{aligned}$$
(44)

where the two terms \(\delta _0\) and \(\delta _1\) symbolize arbitrary constants. We adopt a particular form of the functionals \(f_1\) and \(f_2\) that make the above model as

$$\begin{aligned} f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})= \mathcal {R}+\delta _1\mathcal {L}_{m}\mathcal {T}. \end{aligned}$$
(45)

4.2.1 Stellar solution for \(\mathcal {L}_{m}=P\)

Here, we follow the same pattern again as we already discuss in the previous subsection. The equations of motion for the considered geometry are explored for the matter Lagrangian as \(\mathcal {L}_{m}=P\). Putting this choice with the model (45) in the field equations (11)–(13) and performing some manipulation leads to

$$\begin{aligned}&e^{-\varrho _2}\left( \frac{\varrho _2'}{r}-\frac{1}{r^2}\right) +\frac{1}{r^2}\nonumber \\&\quad =\left\{ 8\pi +\frac{\delta _1}{2}\big (5P-\rho \big )\right\} \rho +\delta _1 P^2+\frac{s^2}{r^4}, \end{aligned}$$
(46)
$$\begin{aligned}&e^{-\varrho _2}\left( \frac{1}{r^2}+\frac{\varrho _1'}{r}\right) -\frac{1}{r^2}\nonumber \\&\quad =\left\{ 8\pi +\frac{\delta _1}{2}\big (5P-\rho \big )\right\} P-\delta _1 P^2-\frac{s^2}{r^4}, \end{aligned}$$
(47)
$$\begin{aligned}&\frac{e^{-\varrho _2}}{4}\left[ \varrho _1'^2-\varrho _2'\varrho _1'+2\varrho _1''-\frac{2\varrho _2'}{r}+\frac{2\varrho _1'}{r}\right] \nonumber \\&\quad =\left\{ 8\pi +\frac{\delta _1}{2}\big (5P-\rho \big )\right\} P -\delta _1 P^2+\frac{s^2}{r^4}. \end{aligned}$$
(48)

Solving last two equations provides the same value of charge as defined in Eq. (38). Further, the isotropic system can be completely characterized by the first two equations, however, it is not possible to find \(\rho \) and P explicitly due to the appearance of second-order fluid terms. To resolve this issue, we consider a barotropic equation of state represented by

$$\begin{aligned} P=\delta _2\rho , \end{aligned}$$
(49)

where \(\delta _2 \in (0,1)\). After using this equation of state in (46) and (47), we express \(\rho \) and P as

$$\begin{aligned} \rho&=\frac{r^2}{\delta _1 r^2\big (2 \delta _2 ^2+5 \delta _2 -1\big )\big (b_2 b_4 r^2 e^{2 b_2 r^2}+1\big )}\nonumber \\&\quad \times \big [\big \{b_2^2 r^2 \big (b_4^2 e^{4 b_2 r^2} \big (\delta _1 \big (2 \delta _2 ^2+5\delta _2 -1\big ) +64 \pi ^2 r^2\big )\nonumber \\&\quad -4 \delta _1 \big (2 \delta _2 ^2+5 \delta _2 -1\big )+12 \delta _1 b_4 \big (2 \delta _2 ^2+5 \delta _2 -1\big ) e^{2 b_2 r^2}\big )\nonumber \\&\quad +2 b_4 b_2 e^{2 b_2 r^2} \big (3 \delta _1 \big (2 \delta _2 ^2+5 \delta _2 -1\big )+64 \pi ^2 r^2\big )+64 \pi ^2\big \}^{\frac{1}{2}}\nonumber \\&\quad -8 \pi b_2 b_4 r^2 e^{2 b_2 r^2}-8 \pi \big ], \end{aligned}$$
(50)
$$\begin{aligned} P&=\frac{\sqrt{\delta _2} r^2}{\delta _1 r^2\big (3\delta _2-1\big )\big (b_2 b_4 r^2 e^{2 b_2 r^2}+1\big )}\nonumber \\&\quad \times \big [\big \{b_2^2 r^2 \big (4 \delta _1 (3 \delta _2 -1)+4 \delta _1 b_4 (3 \delta _2 -1) e^{2 b_2 r^2}\nonumber \\&\quad +b_4^2 e^{4 b_2 r^2} \big (\delta _1-3 \delta _1 \delta _2 +64 \pi ^2 r^2 \delta _2 \big )\big )+b_2 \big (2 b_4 e^{2 b_2 r^2} \nonumber \\&\quad \times \big (\delta _1-3\delta _1 \delta _2 +64 \pi ^2 r^2 \delta _2 \big ) +8 \delta _1 (3 \delta _2-1)\big )+64\pi ^2\delta _2\big \}^{\frac{1}{2}}\nonumber \\&\quad -\sqrt{\delta _2}\big (8 \pi b_2 b_4 r^2 e^{2 b_2 r^2}+8 \pi \big )\big ], \end{aligned}$$
(51)

where Eqs. (18) and (19) are also used.

4.2.2 Stellar solution for \(\mathcal {L}_{m}=-\rho \)

Another choice of the matter Lagrangian as \(\mathcal {L}_{m}=-\rho \) is considered that makes Eqs. (11)–(13) when combined with the model (45) as

$$\begin{aligned}&e^{-\varrho _2}\left( \frac{\varrho _2'}{r}-\frac{1}{r^2}\right) +\frac{1}{r^2}\nonumber \\&\quad =\left\{ 8\pi +\frac{3\delta _1}{2}\big (P-\rho \big )\right\} \rho +\delta _1 \rho ^2+\frac{s^2}{r^4}, \end{aligned}$$
(52)
$$\begin{aligned}&e^{-\varrho _2}\left( \frac{1}{r^2}+\frac{\varrho _1'}{r}\right) -\frac{1}{r^2}\nonumber \\&\quad =\left\{ 8\pi +\frac{3\delta _1}{2}\big (P-\rho \big )\right\} \rho -\delta _1 \rho ^2-\frac{s^2}{r^4}, \end{aligned}$$
(53)
$$\begin{aligned}&\frac{e^{-\varrho _2}}{4}\left[ \varrho _1'^2-\varrho _2'\varrho _1'+2\varrho _1''-\frac{2\varrho _2'}{r}+\frac{2\varrho _1'}{r}\right] \nonumber \\&\quad =\left\{ 8\pi +\frac{3\delta _1}{2}\big (P-\rho \big )\right\} \rho -\delta _1 \rho ^2+\frac{s^2}{r^4}. \end{aligned}$$
(54)

Simultaneous use of Eqs. (18), (19), (49), (52) and (53) results in the following expressions of \(\rho \) and P as

$$\begin{aligned} \rho&=\frac{r^2}{\delta _1 r^2\big (3\delta _2-1\big )\big (b_2 b_4 r^2 e^{2 b_2 r^2}+1\big )}\nonumber \\&\quad \times \big [\big \{b_2^2 r^2 \big (4 \delta _1 (1-3 \delta _2 )+12 \delta _1 b_4 (3 \delta _2 -1) e^{2 b_2 r^2}\nonumber \\&\quad +b_4^2 e^{4 b_2 r^2}\big (3 \delta _1 \delta _2 -\delta _1 +64 \pi ^2 r^2\big )\big )\nonumber \\&\quad +2 b_4 b_2 e^{2 b_2 r^2} \big (9 \delta _1 \delta _2 -3 \delta _1 +64 \pi ^2 r^2\big )+64 \pi ^2\big \}^{\frac{1}{2}}\nonumber \\&\quad -8 \pi b_2 b_4 r^2 e^{2 b_2 r^2}-8 \pi \big ], \end{aligned}$$
(55)
$$\begin{aligned} P&=\frac{\delta _2 r^2}{\delta _1 r^2\big (3 \delta _2 ^2-3 \delta _2 -2\big )\big (b_2 b_4 r^2 e^{2 b_2 r^2}+1\big )}\nonumber \\&\quad \times \big [\big \{b_2 \big (8\delta _1 \big (3 \delta _2 ^2-3\delta _2 -2\big )+2 b_4 e^{2 b_2 r^2}\nonumber \\&\quad \times \big (\delta _1 \big (3 \delta _2-3 \delta _2 ^2 +2\big )+64 \pi ^2 r^2 \delta _2 ^2\big )\big )\nonumber \\&\quad +b_2^2 r^2 \big (4 \delta _1 \big (3 \delta _2 ^2-3 \delta _2 -2\big )+b_4^2 e^{4 b_2 r^2}\nonumber \\&\quad \times \big (\delta _1 \big (3 \delta _2-3 \delta _2 ^2 +2\big )+64 \pi ^2 r^2 \delta _2 ^2\big )\nonumber \\&\quad +4 \delta _1 b_4 \big (3 \delta _2 ^2-3 \delta _2 -2\big ) e^{2 b_2 r^2}\big )+64 \pi ^2 \delta _2^2\big \}^{\frac{1}{2}}\nonumber \\&\quad -\delta _2\big (8 \pi b_2 b_4 r^2 e^{2 b_2 r^2}+8 \pi \big )\big ]. \end{aligned}$$
(56)

As the graphical exploration for the solution corresponding to model II is concerned, we choose the parametric values as \(\delta _1 \in [0.1,2]\) and \(\delta _2=0.01,0.95\). It has been observed that only positive values of \(\delta _1\) produce the accelerating solution, but the parameter \(\delta _2\) could either be positive or negative [27]. However, when we plot physical properties corresponding to our developed solution for its negative choices, the results are not so well behaved. Hence, we are left with positive values of both parameters.

Fig. 8
figure 8

Energy density and pressure for model II with \(\mathcal {L}_{m}=P\)

Fig. 9
figure 9

Energy density and pressure for model II with \(\mathcal {L}_{m}=-\rho \)

Fig. 10
figure 10

Energy conditions for model II with \(\mathcal {L}_{m}=P\)

Fig. 11
figure 11

Energy conditions for model II with \(\mathcal {L}_{m}=-\rho \)

Fig. 12
figure 12

Stability analysis for model II with \(\mathcal {L}_{m}=P\)

Fig. 13
figure 13

Stability analysis for model II with \(\mathcal {L}_{m}=-\rho \)

The value of the exterior charge remains same as considered for model I. The same properties (already plotted for the first model) are again explored for this model to check its physical significance in the framework of astronomical structures. Figures 8 and 9 exhibit the profiles of the fluid sector for the above described parametric values, and we observe their acceptable nature. We find that this model produces less dense systems in comparison with the first model for all parametric choices. The factors which are plotted in Fig. 3 for model I are again checked for the current scenario and we obtain almost the same results. Therefore, we exclude their graphs from this paper. Further, our model II is also physically viable and this is ensured by the observations which we make in Figs. 10 and 11. Lastly, Figs. 12 and 13 present the variations in the sound speed and adiabatic index w.r.t. \(r,~\delta _1\) and \(\delta _2\). It is found that the developed solution only for \(\mathcal {L}_{m}=P\) is stable, however, the model corresponding to the other choice of the Lagrangian density does not fulfill the required criteria.

5 Concluding remarks

this paper discusses multiple isotropic compact models which are coupled with the electromagnetic field in the framework of \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) gravitational theory. For this purpose, we started off with the consideration of a static geometry admitting spherical symmetry and induced an electric charge through the addition of its corresponding Lagrangian in the modified action defined in Eq. (1). We have then implemented the least-action principle on this action and derived the field equations possessing Lagrangian densities of both the fluid and electromagnetic field. It was observed that there are three independent components of equations of motion in the presence of five unknowns, indicated the extra degrees of freedom and thus made it impossible to find a unique solution. This only led to the assumption of some constraints to deal with such issue. In this regard, we have adopted the Karmarkar condition and a particular \(g_{tt}\) component form, resulted in computation of the \(g_{rr}\) potential such that the ansatz becomes as follows

$$\begin{aligned} \delta _1(r)&=2b_2r^2+\ln b_3,\\ \delta _2(r)&=\ln \big (1+b_2b_4r^2e^{2b_2r^2}\big ). \end{aligned}$$

There are actually three constants \((b_1,b_2,b_3)\) in the above ansatz and the constant \(b_4\) has been expressed in terms of this triplet as \(b_4=16b_1b_2b_3\). Therefore, we only needed three conditions which have been provided by the matching conditions at the interface, i.e., \(\Sigma :~r=\textrm{R}\) in terms of \(g_{tt},~g_{rr}\) and \(g_{tt,r}\) components. The calculated values of this quartet have been provided in Tables 1 and 2 for five distinct compact objects from which we observed the impact of charge on these constants.

We adopted two different (one minimal and one non-minimal) models in this modified context, each of them has been discussed with two different choices of the fluid Lagrangian. The model I contains two parameters which are taken as \(\beta _1 \in [0.1,2]\) and \(\beta _2=0.1,~0.8\). Further, the model II possesses one parameter \(\delta _1\) taken as same as \(\beta _1\) along with an equation of state parameter such as \(\delta _2=0.05,~0.95\). The fluid doublet has been observed acceptable because it fulfills the required behavior of the energy density and pressure (Figs. 1, 2, 8 and 9). We also explored the mass function and reached at the result that the model II possesses less massive interior as compared to the first model for chosen parameters. A necessary condition to be fulfilled is the validity of the energy conditions which has been observed in Figs. 4, 5, 10 and 11, hence, our resulting solutions are physically viable. Finally, the stability check has been employed through two different techniques. We have found that the minimal \(f(\mathcal {R},\mathcal {L}_{m},\mathcal {T})\) theory yields promising results in the context of astrophysical structures for both \(\mathcal {L}_{m}=P\) and \(-\rho \). However, the non-minimal modified model provides stable results only for former choice of the Lagrangian density (Figs. 6, 7, 12 and 13). It must be stressed here that disappearing the model parameters reduces all these outcomes in GR.