diff --git a/README.md b/README.md index 0129e5d2..88f783aa 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ And more on the way. [![bolt-pro](https://larazeus.com/images/bolt-pro-ad.png)](https://larazeus.com/bolt-pro) +[![bolt-preset](https://larazeus.com/images/bolt-preset-ad.png)](https://larazeus.com/bolt-preset) + ## Overview [read more](https://larazeus.com/docs/bolt/v1/overview) about the idea and how Bolt works. diff --git a/docs/advanced/custom-schemata.md b/docs/advanced/custom-schemata.md new file mode 100644 index 00000000..5b2d153d --- /dev/null +++ b/docs/advanced/custom-schemata.md @@ -0,0 +1,23 @@ +--- +title: Custom Schemata +weight: 7 +--- + +the trait `Schemata` is the heart of the form builder, and now you can customize it to your liking. + +> **Note**\ +> This is an advanced feature; please use it only when necessary since you have to mainline it manually with every update for Bolt. + +### First, copy the trait to your app: + +copy the trait from `\LaraZeus\Bolt\Concerns` to your app, let say: `\App\Zeus\Bolt\Concerns` + +### call the trait in a service provider + +in your register method of your `AppServiceProvider` add the following: + +```php +\LaraZeus\Bolt\Filament\Resources\FormResource::getBoltFormSchemaUsing(fn(): array => \App\Zeus\Bolt\Concerns\Schemata::getMainFormSchema()); +``` + +You're done. Customize the form builder to fit your needs. Remember to keep an eye on any changes in future updates so that you will avoid breaking changes. diff --git a/docs/bolt-preset.md b/docs/bolt-preset.md new file mode 100644 index 00000000..a9a57199 --- /dev/null +++ b/docs/bolt-preset.md @@ -0,0 +1,36 @@ +--- +title: Bolt Preset +weight: 1001 +--- + + +## Zeus Bolt Preset + +Create Forms with pre defined templates + +## Available Sets + +🔥 Support Ticket +🔥 Contact Form + +### Get Bolt Preset from [here](https://larazeus.com/bolt-preset) + +## Installation + +To install bolt preset, you only need to require it in your composer by running the command: + +```bash +composer require lara-zeus/bolt-preset +``` + +and that is all :). + +you will get more details after you purchasing the package. + +## Configuration + +if you want to disable the preset button, add this to `zeus-bolt` config file: + +```php +'show_presets' => false, +``` \ No newline at end of file diff --git a/docs/bolt-pro.md b/docs/bolt-pro.md index 4b0be8b7..1cf17b02 100644 --- a/docs/bolt-pro.md +++ b/docs/bolt-pro.md @@ -15,8 +15,11 @@ Get additional fields for bolt. more options to build professional forms - 🔥 Icon Picker, allow your users pick an icon! - 🔥 Image Picker, allow users to pick an image. - 🔥 Dynamic Textbox, allow users to add multiple text values -- 🔥 Signature Pad, collect users signature -- 🔥 terms and conditions +- 🔥 Signature Pad, collect users signature +- 🔥 terms and conditions with custom URLs +- 🔥 Advanced widgets and stats +- 🔥 Forms API +- 🔥 Custom colors and branding per form ### Get Bolt Pro from [here](https://larazeus.com/bolt-pro) @@ -30,4 +33,13 @@ composer require lara-zeus/bolt-pro and that is all :). -you will get more details after you purchasing the package. \ No newline at end of file +you will get more details after you purchasing the package. + +## Configuration + +if you want to disable the preset button, add this to `zeus-bolt` config file: + +```php +'allow_design' => false, +``` + diff --git a/docs/filament.md b/docs/filament.md index 7e941b5f..295c3efe 100644 --- a/docs/filament.md +++ b/docs/filament.md @@ -45,6 +45,8 @@ Bolt is a form builder for your users, with so many use cases included a UI for [![bolt-pro](https://larazeus.com/images/bolt-pro-ad.png)](https://larazeus.com/bolt-pro) +[![bolt-preset](https://larazeus.com/images/bolt-preset-ad.png)](https://larazeus.com/bolt-preset) + ## More Details **✨ to learn more about Bolt the form builder, please visit:** diff --git a/docs/introduction.md b/docs/introduction.md index 397ed87c..38b4b323 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -47,6 +47,8 @@ For example, you can use it as a job board, appointments, ticketing, survey, and [![bolt-pro](https://larazeus.com/images/bolt-pro-ad.png)](https://larazeus.com/bolt-pro) +[![bolt-preset](https://larazeus.com/images/bolt-preset-ad.png)](https://larazeus.com/bolt-preset) + ## Support Available support channels: diff --git a/src/Filament/Resources/FormResource.php b/src/Filament/Resources/FormResource.php index 991fc0c1..2fcf9ff6 100644 --- a/src/Filament/Resources/FormResource.php +++ b/src/Filament/Resources/FormResource.php @@ -2,6 +2,7 @@ namespace LaraZeus\Bolt\Filament\Resources; +use Closure; use Filament\Forms\Components\TextInput; use Filament\Forms\Form; use Filament\Infolists\Components\IconEntry; @@ -42,6 +43,8 @@ class FormResource extends BoltResource protected static ?string $recordTitleAttribute = 'name'; + protected static Closure | array | null $boltFormSchema = null; + public static function getModel(): string { return BoltPlugin::getModel('Form'); @@ -98,7 +101,17 @@ public static function infolist(Infolist $infolist): Infolist public static function form(Form $form): Form { - return $form->schema(static::getMainFormSchema()); + return $form->schema(static::$boltFormSchema ?? static::getMainFormSchema()); + } + + public function getBoltFormSchema(): array | Closure | null + { + return static::$boltFormSchema; + } + + public static function getBoltFormSchemaUsing(array | Closure | null $form): void + { + static::$boltFormSchema = $form; } public static function table(Table $table): Table