zakaria-yacine/laravel-form-builder

AutoFormGenerator is a Laravel package that streamlines form creation by automatically generating forms and their corresponding input fields using Artisan commands. Simplify repetitive tasks, reduce development time, and enhance productivity by generating fully customizable forms directly from the c

1.1.1 2024-09-27 10:29 UTC

This package is auto-updated.

Last update: 2024-10-28 22:50:07 UTC


README

Latest Version on Packagist Total Downloads

Installation

You can install the package via composer:

composer require zakaria-yacine/laravel-form-builder

You can publish the config file with:

php artisan vendor:publish --tag=form-builder-config

This is the contents of the published config file:

<?php

// config for ZakariaYacineBoucetta/LaravelFormBuilder
return [

    'inputTypes' => [
        'text', 'email', 'password', 'number', 'file', 'submit', 'button', 'radio', 'checkbox', 'hidden', 'date', 'select',
    ],

    'bootstrapClasses' => [
        'text' => 'form-control',
        'email' => 'form-control',
        'password' => 'form-control',
        'number' => 'form-control',
        'file' => 'form-control-file',
        'submit' => 'btn',
        'button' => 'btn',
        'radio' => 'form-check-input',
        'checkbox' => 'form-check-input',
        'hidden' => '',
        'date' => 'form-control',
        'select' => 'form-control',
    ],

    'tailwindClasses' => [
        'text' => 'block w-full px-4 py-2 border rounded-md',
        'email' => 'block w-full px-4 py-2 border rounded-md',
        'password' => 'block w-full px-4 py-2 border rounded-md',
        'number' => 'block w-full px-4 py-2 border rounded-md',
        'file' => 'block w-full px-4 py-2 border rounded-md',
        'submit' => 'px-4 py-2 rounded-md',
        'button' => 'px-4 py-2 rounded-md',
        'radio' => 'form-radio',
        'checkbox' => 'form-checkbox',
        'hidden' => '',
        'date' => 'block w-full px-4 py-2 border rounded-md',
        'select' => 'block w-full px-4 py-2 border rounded-md',
    ],

    'bootstrapButtonColors' => [
        'primary' => 'btn-primary',
        'secondary' => 'btn-secondary',
        'success' => 'btn-success',
        'danger' => 'btn-danger',
        'warning' => 'btn-warning',
        'info' => 'btn-info',
        'light' => 'btn-light',
        'dark' => 'btn-dark',
    ],

    'tailwindButtonColors' => [
        'primary' => 'bg-blue-500 text-white',
        'secondary' => 'bg-gray-500 text-white',
        'success' => 'bg-green-500 text-white',
        'danger' => 'bg-red-500 text-white',
        'warning' => 'bg-yellow-500 text-black',
        'info' => 'bg-teal-500 text-white',
        'light' => 'bg-gray-100 text-black',
        'dark' => 'bg-gray-800 text-white',
    ],

    'fileTypes' => [
        'documents' => 'doc,docx,pdf',
        'images' => 'jpg,jpeg,png,gif',
        'videos' => 'mp4,mkv,avi',
    ],
];

Usage

php artisan make:form

Credits

License

The MIT License (MIT). Please see License File for more information.