https://github.com/pratikkuikel/panini
Panini for FilamentPHP : Craft Your Own CMS
https://github.com/pratikkuikel/panini
filamentphp laravel panini wasabi
Last synced: about 2 months ago
JSON representation
Panini for FilamentPHP : Craft Your Own CMS
- Host: GitHub
- URL: https://github.com/pratikkuikel/panini
- Owner: pratikkuikel
- License: mit
- Created: 2024-01-11T04:44:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-03T09:48:08.000Z (4 months ago)
- Last Synced: 2025-03-26T07:42:44.385Z (2 months ago)
- Topics: filamentphp, laravel, panini, wasabi
- Language: PHP
- Homepage: https://github.com/pratikkuikel/panini
- Size: 107 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Panini for FilamentPHP: Craft Your Own CMS idk If It can be called a CMS.
[](https://packagist.org/packages/pratikkuikel/panini)
[](https://github.com/pratikkuikel/panini/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/pratikkuikel/panini/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](https://packagist.org/packages/pratikkuikel/panini)
Not an AI generated Logo which has been upscaled and compressed again using AI.
Panini is a FilamentPHP package designed for developers who crave the freedom to build their own CMS without the constraints of pre-defined structures. It's not a CMS; it's a toolkit that generates Filament resources—Controllers, Factories, Migrations, Seeders, and Models. The star of the show is the Page Manager, allowing you to dynamically generate pages with customizable form fields. Embrace frontend independence and create your unique content management experience, all crafted by you for your project's specific needs. Because sometimes, the best CMS is the one you build yourself.

> I honestly don't know what I have built but It does solve my problem and I will be damned if it solves yours too ! 😈
#### why is this called panini ?
Maybe because it's a sandwich and you can build it any way you like.
## Enough with this monologue ! Let's get it up and running
### Before you begin, Make sure you have Filamentphp installed with default AdminPanelProvider.
👉 [Filamentphp Installation](https://filamentphp.com/docs/3.x/panels/installation)
This package assumes that AdminPanelProvider is the default one.
Now you can install the package via composer:
Make sure you have minimum stability set as dev in composer.json
```json
"minimum-stability": "dev"
``````bash
composer require pratikkuikel/panini
```Publish and run the migrations with:
```bash
php artisan vendor:publish --tag="panini-migrations"
php artisan migrate
```Add Panini Plugin to AdminPanelProvider.
```php
use Pratikkuikel\Panini\PaniniPlugin;return $panel
...
->plugin(new PaniniPlugin())
...```
To enable page auto-discovery change :
```php
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
```TO
```php
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
```Login to your Admin Panel.
There you have it, your raw panini.
Bake it, chef 👨🍳
## Usage
⭐Generate Resources with Resource Generator

⭐Page Manager

## Using Page Manager
Page Manager currently supports two Fields right now, Select and TextInput. Feel Free to add More.
Attributes are the methods you chain to the Selected InputField. Multiple attributes is supported.
Multiple fields can be added to the page, All it needs is a click to `Add field to the page` button.
After you have created the page manager, click on `Generate` button to generate the page.
You can customize the generated page, Find the page in `app\Filament\Admin\Pages` directory and the view file in
`resources\views\filament\admin\pages` directory.The generated fields can be downloaded, reused or shared.
Here is the sample Json Field```json
[
{
"type": "Pratikkuikel\\Panini\\Filament\\Fields\\PaniniTextInput",
"name": "name",
"label": "name",
"attributes": { "required": "true" }
},
{
"type": "Pratikkuikel\\Panini\\Filament\\Fields\\PaniniSelect",
"name": "option",
"label": "Option",
"attributes": { "required": "true" }
}
]
```## Fetching the page data
You can fetch the data using
```php
$data = PageManager::where('name','leslie-winkle')->first();
```Here, [wasabi](https://github.com/pratikkuikel/wasabi) converts your page's data fields into attributes. And those can be accessed using ✅
```php
$data->name
```Instead of ❌
```php
$data->data['name'];
```If there's a need to query page's data use [Json Where Clauses](https://laravel.com/docs/10.x/queries#json-where-clauses)
```php
$data = PageManager::where('data->name','robot')->get();
```## Testing
I beg my pardon, TDD Army !
There are no tests, at least not at the moment.
Will get it done, will I ?## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Laravel](https://laravel.com)
- [FilamentPhp](https://filamentphp.com)
- [Spatie](https://spatie.be)
- [Touhidurabir](https://github.com/touhidurabir/laravel-stub-generator)
- [pratikkuikel](https://github.com/pratikkuikel)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.