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 Components Laravel Package

okipa/laravel-form-components

Ready-to-use, fully customizable Laravel form components that generate HTML for you. Livewire compatible, supports Bootstrap 4/5 (TailwindCSS 3 planned). Includes form, input, textarea and more, with model binding and flexible configuration.

View on GitHub
Deep Wiki
Context7

Upgrade from okipa/laravel-bootstrap-components to okipa/laravel-form-components

This package is a full rewrite of the okipa/laravel-bootstrap-components package.

This rewrite has been made for the following reasons:

  • Migrating to a new repository with a name that would give a better representation of the package purpose
  • Allowing choosing which UI framework is used to render components
  • Taking advantage of the power of X Blade components which are allowing us to manipulate HTML directly instead of having to manipulate PHP
  • Migrating code to PHP 8.0/8.1
  • Adding and improving features
  • Adding Livewire compatibility

Follow the steps below to upgrade the package.

Replace native HTML form calls

You now can use a form component which will automatically generate CSRF and method spoofing hidden fields for you.

As so, you should:

  • Replace your native HTML form implementations
  • Remove you CSRF and spoofing method hidden fields implementations

See documentation to check how to use form component.

Replacing component calls

For example, you'll have to replace this component call:

{{ inputEmail()->name('email')->componentHtmlAttributes(['required', 'autofocus', 'autocomplete' => 'email']) }}

By this one:

<x-form::input type="email" name="email" autofocus autocomplete="email" required/>

You'll have to execute this replacement work for each of the following components:

  • All the following components must be replaced by the input component
    • inputText()
    • inputEmail()
    • inputPassword()
    • inputUrl()
    • inputTel()
    • inputNumber()
    • inputColor()
    • inputDate()
    • inputTime()
    • inputDateTime()
    • inputFile()
  • The textarea() component must be replaced by the textarea component
  • The select() component must be replaced by the select component
  • The inputCheckbox() component must be replaced by the checkbox component
  • The inputSwitch() component must be replaced by the toggle-switch component
  • The inputRadio() component must be replaced by the radio component
  • All the following components must be replaced by the button.submit component
    • submit()
    • submitValidate()
    • SubmitCreate()
    • SubmitUpdate()
  • All the following components must be replaced by the button.link component
    • button()
    • buttonBack()
    • buttonCancel()
    • buttonLink()

Of course if you did use the Facade way to call the okipa/laravel-bootstrap-components components in your views, you'll have to adapt the replacements specified above.

Undocumented changes

If you see any forgotten and undocumented changes, please submit a PR to add them to this upgrade guide.

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.
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
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope