File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
tests/HelperFunctions/filesystem Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ Provides Laravel-specific and pure PHP helper functions.
5656 - [to_rfc2822_email](#to_rfc2822_email)
5757 - [to_swiftmailer_emails](#to_swiftmailer_emails)
5858
59+ - [Filesystem](#filesystem)
60+ - [relative_path](#relative_path)
61+
5962- [Format](#format)
6063 - [get_dump](#get_dump)
6164 - [format_bytes](#format_bytes)
@@ -276,6 +279,26 @@ $address = to_swiftmailer_emails(['address' => '
[email protected] ', 'name' =>
276279// [" [email protected] " => " John Doe" ] 277280` ` `
278281
282+ # # Filesystem
283+
284+ # ### `relative_path()`
285+
286+ Returns the relative path of a directory given another one:
287+
288+ ` ` ` php
289+ $path = relative_path(' /var/www/htdocs' , ' /var/www/htdocs/example' )
290+
291+ // ' ../'
292+ ` ` `
293+
294+ You can pass relative paths as a parameters:
295+
296+ ` ` ` php
297+ $path = relative_path(' /var/www/htdocs/example/public/../../' , ' /var/' )
298+
299+ // ' www/htdocs/'
300+ ` ` `
301+
279302# # Format
280303
281304# ### `get_dump()`
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Illuminated \Helpers \HelperFunctions \Tests \FileSystem ;
3+ namespace Illuminated \Helpers \HelperFunctions \Tests \Filesystem ;
44
55use Illuminated \Helpers \HelperFunctions \Tests \TestCase ;
66
You can’t perform that action at this time.
0 commit comments