Closed yann-yvan closed 10 months ago
can you add
->optionsColumn('string')
and see if it works?
\LaraZeus\Qr\Components\Qr::make('code')
->optionsColumn('options'),
I did a smal update to fix this
and to use the QR code with table actions, you can use this
Action::make('qr-action')
->fillForm(fn(Model $record) => [
'qr-options' => Qr::getDefaultOptions(),// or $record->qr-options
'qr-data' => 'https://',// or $record->url
])
->form(Qr::getFormSchema('qr-data', 'qr-options'))
->action(fn($data) => dd($data)),
Typed property LaraZeus\Qr\Components\Qr::$optionsColumn must not be accessed before initialization
usage :
$table ->actions([ // Tables\Actions\ViewAction::make(), Action::make("Qr") ->label("Scan") ->icon("heroicon-o-qr-code") ->fillForm(fn(HealthBook $record): array => [ 'code' => "https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=" . $record->{HealthBook::SEQUENCE}, ])->form([ \LaraZeus\Qr\Components\Qr::make('code'), ]) ->modalFooterActions() ->slideOver() ]);