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

rawilk/laravel-form-components

A set of reusable Blade form components for Laravel that make building consistent forms quick and clean. Includes inputs, selects, checkboxes, radios, buttons, errors, and styling-friendly markup, with flexible config and easy customization.

View on GitHub
Deep Wiki
Context7

title: Extra Attributes sort: 5

Introduction

There may be times when you are rendering an input component where you may have an unknown amount of attributes you need to pass to the component. The most common use case I have for it is when I'm building up an array of attributes for a component, and some attributes are conditional on what I send to the component.

The current blade syntax doesn't allow for using conditional logic like [@if](https://github.com/if) when you're rendering a blade component, so I've come up with a prop called extraAttributes on most of the components offered by this package. This will allow you to pass an array of attributes to the element, and the element will then render them onto the applicable element for you.

Basic Usage

Here's an arbitrary example of how one could build up an array of attributes in a Livewire component, and then pass them to an input component.

public function getInputAttributesProperty(): array
{
    return array_filter([
        '[@click](https://github.com/click)' => "console.log('hi')",
        'data-name' => $this->name,
        'data-foo' => $this->name === 'foo' ? 'true' : null,
    ]);
}
<x-input :extra-attributes="$this->inputAttributes" />
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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor