reportei/laraground

Laravel components playground

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:JavaScript

dev-master 2020-08-16 07:27 UTC

This package is not auto-updated.

Last update: 2024-11-05 04:14:26 UTC


README

Just add config in View Component Class

class Button extends Component
{
    ...
    protected $lgDesc = 'Form/Button';
    protected $lgView = 'components.form.button';
    
    ...
    public static function laraground()
    {
        return [
            'attributes' => [
                'label' => 'Button',
                'type' => 'button',
                'color' => 'primary',
                'size' => 'md',
            ],
            'slots' => [
                'slot' => 'label' // targint label attribute for control binds
            ],
            'model' => '' // wire:model when is input, select or textarea
                          // see https://laravel-livewire.com/docs/data-binding/
        ];
    }
}