diff --git a/app/Facades/Form.php b/app/Facades/Form.php new file mode 100644 index 00000000..00ccbcc0 --- /dev/null +++ b/app/Facades/Form.php @@ -0,0 +1,13 @@ +app->register(IdeHelperServiceProvider::class); } + $this->app->singleton('custom-form', function ($app) { + return new CustomFormBuilder($app->make(Html::class)); + }); + $this->app->singleton('settings', function () { return new Setting(); }); diff --git a/app/Services/CustomFormBuilder.php b/app/Services/CustomFormBuilder.php new file mode 100644 index 00000000..aaa2dd2e --- /dev/null +++ b/app/Services/CustomFormBuilder.php @@ -0,0 +1,39 @@ +html = $html; + } + + public function text($name, $value = null, $options = []) + { + return new HtmlString( + $this->html->input('text', $name, $value)->attributes($options) + ); + } + + public function select($name, $list = [], $selected = null, $options = []) + { + return new HtmlString( + $this->html->select($name)->options($list, $selected)->attributes($options) + ); + } + + public function textarea($name, $value = null, $options = []) + { + return new HtmlString( + $this->html->textarea($name, $value)->attributes($options) + ); + } + + // Add other methods as needed +} diff --git a/config/app.php b/config/app.php index 51ecba35..4d0b4f5d 100644 --- a/config/app.php +++ b/config/app.php @@ -5,20 +5,17 @@ use Illuminate\Support\Facades\Facade; return [ - 'version' => '2.6.3', + 'version' => '2.7.0', 'appsource' => env('APP_SOURCE', 'https://appslist.heimdall.site/'), - //'providers' => [ - //App\Providers\FormMacroServiceProvider::class, // Add this line - //], 'aliases' => Facade::defaultAliases()->merge([ 'EnhancedApps' => App\EnhancedApps::class, + 'Form' => App\Facades\Form::class, 'Redis' => Illuminate\Support\Facades\Redis::class, 'SupportedApps' => App\SupportedApps::class, 'Yaml' => Symfony\Component\Yaml\Yaml::class, - 'Form' => App\Providers\FormMacroServiceProvider::class ])->toArray(), 'auth_roles_enable' => (bool) env('AUTH_ROLES_ENABLE', false),