alexsabur / orchid-livewire
A Livewire macro for Orchid Platform
Installs: 5 359
Dependents: 1
Suggesters: 0
Security: 0
Stars: 25
Watchers: 1
Forks: 13
Open Issues: 4
Requires
- illuminate/support: ^9.0|^10.0
- livewire/livewire: ^2.0
- orchid/platform: ^12.0|^13.0|^14.0
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-11-28 06:01:11 UTC
README
Package description: A Livewire macro for Orchid Platform
Installation
Install via composer
# for Orchid 12, 13, 14 composer require livewire/livewire alexsabur/orchid-livewire:^5.3 # for Orchid 11 composer require livewire/livewire alexsabur/orchid-livewire:^4.0 # or for Orchid 10 composer require livewire/livewire alexsabur/orchid-livewire:^3.0
Publish orchid-livewire assets
php artisan vendor:publish --tag=orchid-livewire-assets
Publish original assets livewire (optional)
php artisan vendor:publish --tag=livewire:assets
Publish package config (optional)
php artisan vendor:publish --provider="AlexSabur\OrchidLivewire\ServiceProvider"
Usage
For Table and Sight
/** * @return array */ public function columns(): array { return [ TD::set('status', __('Name')) ->sort() ->cantHide() ->filter(TD::FILTER_TEXT) ->livewire('user.pool-status'), // livewire will send an "email" with the key "email" TD::set('email', __('email')) ->livewire('user-email', key: fn (User $user) => "td-user-email-{$user->id}"), // livewire will be passed the model under the key 'user' TD::set('some_data', __('some data')) ->livewire('some-component', 'user', fn (User $user) => "td-some-data-{$user->id}"), TD::set('id', __('ID')) ->livewire('user.id', function (User $user) { return [ 'user' => $user ]; }, fn (User $user) => "td-user-{$user->id}"), ]; }
For Screen
/** * Views. * * @return Layout[] */ public function layout(): array { return [ // With only user and role from query Layout::livewire('user.pay-status') ->only(['user', 'role']), // With except role from query Layout::livewire('foo') ->except('role'), // Without data from query Layout::livewire('baz') ->empty(), // With all from query Layout::livewire('baz'), ]; }
Security
If you discover any security related issues, please email alexsabur@live.ru instead of using the issue tracker.
Credits
This package is bootstrapped with the help of melihovv/laravel-package-generator.