Flatpack
- Quickly create CRUD (Create, Read, Update, Delete) interfaces for your Eloquent models.
- Define components with simple and declarative YAML files.
- Build a complete administration panel for your Laravel app in seconds.
Quick Install
You can install the package via composer:
composer require flatpack/flatpack
Publish the config file and compiled assets:
php artisan vendor:publish --tag="flatpack"
Usage
Generate the flatpack composition files for App\Models\Post
model...
php artisan make:flatpack Post
This command will create two files:
- A form template
/flatpack/posts/form.yaml
, that defines the layout composition of your posts form. - A list template
/flatpack/posts/list.yaml
, that defines the layout composition of your posts table with pagination.
Let's check the result, visit /backend/posts
.
Now start assembling, grab the generated files and define how they should look!
Examples
Defining a form
Example of generated file /flatpack/posts/form.yaml
fields:
name:
label: Name
type: text
description:
label: Description
type: textarea
created_at:
label: Created
type: datetime-picker
updated_at:
label: Updated
type: datetime-picker
Defining a list
Example of generated /flatpack/posts/list.yaml
columns:
id:
label: ID
sortable: true
searchable: true
name:
label: Name
sortable: true
searchable: true
created_at:
label: Created
type: datetime
format: "Y-m-d H:i:s"
sortable: true
updated_at:
label: Updated
type: datetime
format: "Y-m-d H:i:s"
sortable: true
You can edit the yaml composition files by mapping your model's attributes with components of differnt types and features.
Requirements
- PHP 8.x
- Composer
- Laravel 9.x
Includes:
Dependency | Version | More info |
---|---|---|
Tailwindcss | 3.0.23 |
Docs |
Alpine | 3.9.0 |
Docs |
Livewire | 2.6 |
Docs |
WireUI | 1.0 |
Github, Docs |
Livewire Tables | 1.22 |
Github |
Livewire EditorJS | 1.4 |
Github |
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.