File tree Expand file tree Collapse file tree 2 files changed +37
-7
lines changed Expand file tree Collapse file tree 2 files changed +37
-7
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,26 @@ static public function formatWithBaseDirectory(?string $path = null)
8787 );
8888 }
8989
90+ /**
91+ * Format path with Domain Path
92+ *
93+ * @param string $path
94+ * - [optional] You can pass a path to include with the domain link
95+ * - Final result: i.e https://domain.com/path
96+ *
97+ * @return string
98+ */
99+ static public function formatWithDomainURI (?string $ path = null )
100+ {
101+ $ server = rtrim (
102+ self ::getServers ('domain ' ),
103+ '/ '
104+ );
105+ return self ::pathReplacer (
106+ "{$ server }/ {$ path }"
107+ );
108+ }
109+
90110 /**
91111 * Get the base URL and domain information.
92112 *
Original file line number Diff line number Diff line change @@ -286,36 +286,46 @@ function config_pagination(?array $options = [])
286286if (! function_exists ('directory ' )) {
287287 /**
288288 * Get Base Directory `Path`
289+ * @param string $path
290+ * - [optional] You can pass a path to include with the base directory
291+ * - Final result: i.e C:/server_path/path
289292 *
290293 * @return string
291294 */
292- function directory ()
295+ function directory (? string $ path = null )
293296 {
294- return base_path ();
297+ return base_path ($ path );
295298 }
296299}
297300
298301if (! function_exists ('base_path ' )) {
299302 /**
300303 * Get Base Directory `Path`
304+ * @param string $path
305+ * - [optional] You can pass a path to include with the base directory
306+ * - Final result: i.e C:/server_path/path
301307 *
302308 * @return string
303309 */
304- function base_path ()
310+ function base_path (? string $ path = null )
305311 {
306- return env_orm ()->getDirectory ( );
312+ return env_orm ()->formatWithBaseDirectory ( $ path );
307313 }
308314}
309315
310316if (! function_exists ('domain ' )) {
311317 /**
312- * Get Domain `URL` Link
318+ * Get Domain `URL` URI
319+ *
320+ * @param string $path
321+ * - [optional] You can pass a path to include with the domain link
322+ * - Final result: i.e https://domain.com/path
313323 *
314324 * @return string
315325 */
316- function domain ()
326+ function domain (? string $ path = null )
317327 {
318- return env_orm ()->getServers ( ' domain ' );
328+ return env_orm ()->formatWithDomainURI ( $ path );
319329 }
320330}
321331
You can’t perform that action at this time.
0 commit comments