Download the PHP package uspdev/forms without Composer
On this page you can find all versions of the php package uspdev/forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package forms
Short Description Formulários dinâmicos com persistência
License GPL-2.0-or-later
Informations about the package forms
Forms
Forms é uma biblioteca uspdev que permite gerar formulários dinâmicos a partir de definição armazenado em banco de dados e opcionalmente persiste os resultados.
Features
- Gera formulários a partide definição em BD;
- Supporta estilos em Bootstrap 4 e 5;
- Processa submissão dos formulários com validação e persistência;
- Integra com aplicações Laravel 11 em diante.
Installation
-
Instale a biblioteca por meio do Composer:
- Publish the configuration and migrations:
Run the following commands to publish the package's configuration and migrations:
php artisan vendor:publish --provider="Uspdev\Forms\Providers\FormServiceProvider" --tag=config
php artisan vendor:publish --provider="Uspdev\Forms\Providers\FormServiceProvider" --tag=migrations
- Run migrations:
After publishing, run the migrations to create the necessary tables:
php artisan migrate
Configuration
You can customize the package's settings by modifying the config/forms.php file. Here, you can set the default Bootstrap version.
Usage
-
Crie uma entrada na tabela form_definitions
- Generate the form in your view:
Use the FormGenerator class to render the form in your Blade template:
use Uspdev\Forms\FormGenerator;
$formGenerator = new FormGenerator(storage_path('forms/contact_form.yaml'));
echo $formGenerator->generateForm();
- Handle form submissions:
In your controller, handle the form submission by saving the data to the database:
public function submit(Request $request)
{
// Validate and store form data...
}
Contributing
Contributions are welcome! Please follow these steps to contribute:
Fork the repository. Create a new branch (git checkout -b feature/YourFeature). Make your changes and commit them (git commit -m 'Add some feature'). Push to the branch (git push origin feature/YourFeature). Create a new Pull Request.
License
This package is licensed under the MIT License. See the LICENSE file for details.
Summary of Contents
- Package Overview: Describes what the package does.
- Features: Highlights key functionalities.
- Installation Steps: Provides detailed installation instructions.
- Configuration Details: Guides on customizing settings.
- Usage Examples: Shows how to create a YAML form and use it in your application.
- Contribution Guidelines: Encourages contributions with clear steps.
- License Information: Indicates the licensing of the package.