11<?php
22
33use Illuminate \Support \MessageBag ;
4+ use SmallRuralDog \Admin \Components \Widgets \Html ;
5+ use SmallRuralDog \Admin \Layout \Content ;
46
57if (!function_exists ('admin_path ' )) {
68
@@ -17,7 +19,6 @@ function admin_path($path = '')
1719 }
1820}
1921
20-
2122if (!function_exists ('admin_base_path ' )) {
2223 /**
2324 * Get admin url.
@@ -65,13 +66,14 @@ function admin_url($path = '', $parameters = [], $secure = null)
6566if (!function_exists ('admin_file_url ' )) {
6667 function admin_file_url ($ path )
6768 {
68- if (\Illuminate \Support \Str::contains ($ path ,"// " )){
69+ if (\Illuminate \Support \Str::contains ($ path , "// " )) {
6970 return $ path ;
7071 }
7172
7273 return \Storage::disk (config ('admin.upload.disk ' ))->url ($ path );
7374 }
74- };
75+ }
76+ ;
7577
7678if (!function_exists ('admin_toastr ' )) {
7779
@@ -102,3 +104,18 @@ function admin_asset($path)
102104 return (config ('admin.https ' ) || config ('admin.secure ' )) ? secure_asset ($ path ) : asset ($ path );
103105 }
104106}
107+ if (!function_exists ('instance_content ' )) {
108+
109+ function instance_content ($ content = '' )
110+ {
111+ if (is_string ($ content )) {
112+ return Html::make ()->html ($ content );
113+ } elseif ($ content instanceof \Closure) {
114+ $ c_content = new Content ();
115+ call_user_func ($ content , $ c_content );
116+ return $ c_content ;
117+ } else {
118+ return $ content ;
119+ }
120+ }
121+ }
0 commit comments