Skip to content

Commit 2bfac5b

Browse files
authored
Update README.md
1 parent 697dc00 commit 2bfac5b

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This plugin creates widgets with tab layout for Filament Admin.
99

1010
![filament-tab-1](https://github.com/solutionforest/filament-tab-plugin/assets/68525320/0dd61497-1c22-474c-b74a-75700df51292)
1111

12+
Demo site : https://filament-cms-website-demo.solutionforest.net/
13+
14+
Demo username : demo@solutionforest.net
15+
16+
Demo password : 12345678 Auto Reset every hour.
1217
## Installation
1318

1419
You can install the package via composer:
@@ -57,13 +62,44 @@ class DummyTabs extends BaseWidget
5762

5863
Tabs may have an icon and badge, which you can set using the `icon()` and `badge()` methods:
5964
```php
60-
Tab::make('Label 1')
61-
->icon('heroicon-o-bell')
62-
->badge('39')
63-
->schema([
64-
// ...
65-
]),
65+
Tab::make('Label 1')
66+
->icon('heroicon-o-bell')
67+
->badge('39')
68+
->schema([
69+
// ...
70+
]),
71+
```
72+
73+
## Assign parameters to component
74+
Additionally, you have the option to pass an array of data to your component.
75+
> **Tip: Ensure that the index or key of the `schemaComponentData` array matches the component's index or key. This is important for proper rendering and functioning of the component. !!!**
76+
```php
77+
protected function schema(): array
78+
{
79+
return [
80+
81+
// SAMPLE CODE, CAN DELETE
82+
TabLayoutTab::make('Label 1')
83+
->icon('heroicon-o-bell')
84+
->badge('39')
85+
->schema([
86+
new \Filament\Widgets\AccountWidget,
87+
new \App\Filament\Resources\ProductCategoryResource\Pages\ViewProductCategory() // TARGET COMPONENT
88+
])
89+
->schemaComponentData([
90+
null,
91+
['record' => 1 ] // TARGET COMPONENT'S DATA
92+
]),
93+
TabLayoutTab::make('Label 2')
94+
->schema([
95+
new \Filament\Widgets\FilamentInfoWidget(),
96+
]),
97+
98+
];
99+
}
66100
```
101+
![tab-example-1](https://github.com/solutionforest/filament-tab-plugin/assets/68525320/1061acbb-cfdf-422f-8c2f-1c0f709ecf7f)
102+
![tab-example-2](https://github.com/solutionforest/filament-tab-plugin/assets/68525320/23898112-9d25-4260-bed1-081e679b8b68)
67103

68104

69105
## Changelog

0 commit comments

Comments
 (0)