File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed
Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 1- <?php declare (strict_types=1 );
1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Illuminate \Support \Str ;
26
37if (!function_exists ('batch ' )) {
48 /**
@@ -11,3 +15,31 @@ function batch()
1115 return app ('Mavinoo\Batch\Batch ' );
1216 }
1317}
18+
19+ if (!function_exists ('str ' )) {
20+ /**
21+ * Get a new stringable object from the given string.
22+ *
23+ * @param string|null $string
24+ *
25+ * @return \Illuminate\Support\Stringable|mixed
26+ */
27+ function str ($ string = null )
28+ {
29+ if (func_num_args () === 0 ) {
30+ return new class {
31+ public function __call ($ method , $ parameters )
32+ {
33+ return Str::$ method (...$ parameters );
34+ }
35+
36+ public function __toString ()
37+ {
38+ return '' ;
39+ }
40+ };
41+ }
42+
43+ return Str::of ($ string );
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments