Skip to content

Commit

Permalink
Merge pull request #53 from lara-zeus/update-docs
Browse files Browse the repository at this point in the history
update docs
  • Loading branch information
atmonshi authored Jun 9, 2023
2 parents 8c6c3f6 + 6df8bfd commit 55752a5
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 17 deletions.
36 changes: 29 additions & 7 deletions docs/add-fields.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
title: add custom fields
weight: 10
weight: 6
---

## Composer
## Create Custom Fields

for example we want to allow our users to use rating in the forms:
you can add any custom fields you want that available on the [filament core](https://filamentphp.com/docs/2.x/forms/fields) or [filament plugins](https://filamentphp.com/plugins).

for example, we want to allow our users to use rating in the forms:
first install the package:

```bash
composer require yepsua/filament-rating-field
```
Expand All @@ -19,23 +22,42 @@ the file name must be the same as the component class

namespace App\Zeus\Fields;

use Filament\Forms\Components\Toggle;
use LaraZeus\Bolt\Fields\FieldsContract;

class Rating extends FieldsContract
{
public $renderClass = '\Yepsua\Filament\Forms\Components\Rating';
public $sort = 8;
public string $renderClass = '\Yepsua\Filament\Forms\Components\Rating';

public function title()
public int $sort = 99;

public function title(): string
{
return __('Rating');
}

public static function getOptions()
public static function getOptions(): array
{
return [
Toggle::make('options.is_required')->label(__('Is Required')),
];
}
}

```

check out the contract `LaraZeus\Bolt\Fields\FieldsContract` and see all the available methods.


## Caching

bolt will automatically add the field to the form builder.
there is a cache for ll fields, so remember to flush the key `bolt.fields`


## Disabling

you can disable any field temporally by adding:
```php
public bool $disabled = true;
```
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Configuration
weight: 3
weight: 4
---

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Events
weight: 4
weight: 5
---

## Available Events
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Installation
weight: 2
weight: 3
---

## Composer
Expand Down
5 changes: 2 additions & 3 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ included a UI for the frontend bilt with filament

**[Demo](https://demo.larazeus.com) · [Github](https://github.com/lara-zeus/bolt)**

## features and roadmap
## Features
- 🔥 built with [TALL stack](https://tallstack.dev/)
- 🔥 using [filament](https://filamentadmin.com) as an admin panel
- 🔥 Frontend scaffolding, highly customizable.
Expand Down Expand Up @@ -64,6 +64,5 @@ included a UI for the frontend bilt with filament

## Support
available support channels:
* using our channel `#bolt` on [Discord](https://filamentphp.com/discord)
* open an issue on [GitHub](https://github.com/lara-zeus/bolt/issues)
* email us using the [contact center](https://atm-code.com/contact-us/lara-zeus)
* email us using the [contact center](https://still-code.com/contact-us/lara-zeus)
37 changes: 37 additions & 0 deletions docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Overview
weight: 2
---

## Overview
here is the structure of the table; it will give you an idea of how Bolt works:
.

![bolt-diagram](http://site.test/images/docs/bolt/bolt-diagram.png)

## The concept:

### Form:
The main component of all of this. Including all descriptive texts and the form options.

### Sections:
To group the fields, it has some options like columns number.
Also, an option to display sections as pages or wizards, or tabs

### Fields
fields are fields, most of the common types are available, and you can create custom ones

### Categories:
It's a way to organize and display the forms in the front end.
Any form not linked to a category won't be shown in the forms list at the front end.

### Collections:
collections are datasets used for lists like checkboxes and select menus.

### Responses:
Every submission has a response record per user.

### Responses Fields:
Fields are related to each response and each field of the form. And they contain the user input.

This structure helps to query any reports you want with ease.
6 changes: 2 additions & 4 deletions docs/render-hooks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: render hooks
weight: 11
weight: 7
---

## Render Hooks
Expand Down Expand Up @@ -36,11 +36,9 @@ Bolt also utilize these hooks to make it easier for you to customize any views
- after rendering any field in all forms


and more are coming

### Usage

you can defind your hooks in your service provider:
you can define your hooks in your service provider:

```php
Filament::registerRenderHook(
Expand Down

0 comments on commit 55752a5

Please sign in to comment.