Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Form Laravel Package

smirltech/laravel-form

View on GitHub
Deep Wiki
Context7

Laravel Form

Laravel Form components

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This is a package that provides a bunch of form components ready to use in your Laravel application and provides the best hanlding for frome validation errors.

Originally created for Livewire projects, but can be used in any Laravel project.

  • The components are built using Bootstrap 5.
  • Each component has a label, a name, and a value. You can pass the value as a model attribute or a value attribute.
  • Required fields are automatically detected and displayed with a red asterisk.
  • Errors are displayed automatically below the input if there is any.
  • The select uses the Selectize.js library to display a nice select input with search and multiple selection.
  • The ckeditor uses the CKEditor 5 library to display a nice WYSIWYG editor.

Installation

Install the package via composer:

composer require smirltech/laravel-form

Add <x-form::scripts/> component to your layout:

....
<x-form::scripts/>

Usage

Here are some examples of how to use the components.

Input

Use the x-form::input component to display a text input.

  • type attribute to set the input type.
  • placeholder attribute to display a placeholder.
  • required attribute to set the input as required.
  • wire:model attribute to bind the input to a model attribute.
  • name attribute to set the input name.
  • label attribute to set the input label.

<x-form::input label="Nom" required wire:model="hotel.name" name="name"/>

img_2.png

Select

use the x-form::select component to display a select input with options. you can pass the options as an array or a collection, or enums.

  • multiple attribute to allow multiple selection.
  • placeholder attribute to display a placeholder.'
<!-- using model attribute -->
<x-form::select label="Ville" wire:model="city" :options="$cities"/>

<!-- using name -->
<x-form::select label="Ville" name="city" :options="$cities"/>

<!-- using foreach loop -->
<x-form::select label="Ville" name="city">
    @foreach($cities as $city)
    <option value="{{$city->value}}">{{$city->name}}</option>
    @endforeach
</x-form::select>

img.png

Ckeditor

Use the x-form::ckeditor component to display a WYSIWYG editor.

  • height attribute to set the editor height.
  • value attribute to set the editor value.

<x-form::ckeditor
    label="Description"
    height="200"
    name="description"
    value="Lorem ipsum dolor sit amet."/>

img_1.png

Input Excel


<x-form::input.xlsx label="Fichier" name="file"/>

img_3.png

Contributing

The package is still in development, so feel free to contribute.

License

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

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium