Skip to content

Commit e54694d

Browse files
Add missing readme
1 parent 0ddbb93 commit e54694d

File tree

1 file changed

+44
-28
lines changed

1 file changed

+44
-28
lines changed

README.md

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/unexpectedjourney/filament-sticky-resource-form-footers/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/unexpectedjourney/filament-sticky-resource-form-footers/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/unexpectedjourney/filament-sticky-resource-form-footers.svg?style=flat-square)](https://packagist.org/packages/unexpectedjourney/filament-sticky-resource-form-footers)
77

8-
9-
10-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
8+
Add sticky footers to the Creat/Edit pages of your Filament resources. Inspired heavily by https://github.com/awcodes/filament-sticky-header/.
119

1210
## Installation
1311

@@ -17,43 +15,61 @@ You can install the package via composer:
1715
composer require unexpectedjourney/filament-sticky-resource-form-footers
1816
```
1917

20-
You can publish and run the migrations with:
21-
22-
```bash
23-
php artisan vendor:publish --tag="filament-sticky-resource-form-footers-migrations"
24-
php artisan migrate
25-
```
18+
## Usage
2619

27-
You can publish the config file with:
20+
Just add the plugin to your panel provider, and you're good to go.
2821

29-
```bash
30-
php artisan vendor:publish --tag="filament-sticky-resource-form-footers-config"
22+
```php
23+
use UnexpectedJourney\FilamentStickyResourceFormFooters\FilamentStickyResourceFormFootersPlugin;
24+
25+
public function panel(Panel $panel): Panel
26+
{
27+
return $panel
28+
->plugins([
29+
FilamentStickyResourceFormFootersPlugin::make(),
30+
])
31+
])
32+
}
3133
```
3234

33-
Optionally, you can publish the views using
35+
### Floating Theme
3436

35-
```bash
36-
php artisan vendor:publish --tag="filament-sticky-resource-form-footers-views"
37-
```
37+
To use the 'Floating Theme' use the `floating()` method when instantiating the plugin.
3838

39-
This is the contents of the published config file:
39+
When using the floating theme you can also use the `colored()` method to add your primary background color to the footer.
4040

4141
```php
42-
return [
43-
];
42+
use UnexpectedJourney\FilamentStickyResourceFormFooters\FilamentStickyResourceFormFootersPlugin;
43+
44+
45+
public function panel(Panel $panel): Panel
46+
{
47+
return $panel
48+
->plugins([
49+
FilamentStickyResourceFormFootersPlugin::make()
50+
->floating()
51+
->colored()
52+
])
53+
]);
54+
}
4455
```
4556

46-
## Usage
57+
Both the `floating()` and `colored()` methods can receive closure that will be evaluated to determine if the theme should be applied. This allows you to apply the theme conditionally, for instance, based off of user preferences.
4758

4859
```php
49-
$filamentStickyResourceFormFooters = new UnexpectedJourney\FilamentStickyResourceFormFooters();
50-
echo $filamentStickyResourceFormFooters->echoPhrase('Hello, UnexpectedJourney!');
51-
```
52-
53-
## Testing
54-
55-
```bash
56-
composer test
60+
use UnexpectedJourney\FilamentStickyResourceFormFooters\FilamentStickyResourceFormFootersPlugin;
61+
62+
63+
public function panel(Panel $panel): Panel
64+
{
65+
return $panel
66+
->plugins([
67+
FilamentStickyResourceFormFootersPlugin::make()
68+
->floating(fn():bool => auth()->user()->use_floating_header)
69+
->colored(fn():bool => auth()->user()->use_floating_header)
70+
])
71+
]);
72+
}
5773
```
5874

5975
## Changelog

0 commit comments

Comments
 (0)