protonemedia / laravel-splade

💫 The magic of Inertia.js with the simplicity of Blade 💫 - Splade provides a super easy way to build Single Page Applications (SPA) using standard Laravel Blade templates, and sparkle it to make it interactive. All without ever leaving Blade.
https://splade.dev
MIT License
1.47k stars 111 forks source link

Not able to bind x-splade-checkboxes (or x-splade-checkbox) #485

Closed bhattji closed 7 months ago

bhattji commented 1 year ago

I have tried all the methods, but I am not able to bind the x-splade-checkboxes/x-splade-checkbox . I have values in database, which I am getting from database, if the value is true, I expect the respctive x-splade-checkbox to be checked, but there is no way the x-splade-checkbox gets checked.

Please help at the earliest

You may use the built-in Artisan Command to show the installed versions of the packages:

php artisan splade:show-versions

Make sure both Splade packages (JS + PHP) are up-to-date and on the same version. For example, when using version 0.5.0 of the PHP package, you should use the same JavaScript package version.

Description:

Steps To Reproduce Issue:

Adel-Kazem commented 1 year ago

I faced similar issue, here's what worked for me:

note: First you have to publish components related files inside the views file by using the following command line: php artisan vendor:publish --provider="ProtoneMedia\Splade\ServiceProvider" --tag="views"

Then inside the resources/views/vendor/splade/form/checbox

The content of the blade file and replace it with the following:

<div {{ $attributes->only(['v-if', 'v-show', 'class']) }}>

@includeWhen($help, 'splade::form.help', ['help' => $help])
@includeWhen($showErrors, 'splade::form.error', ['name' => $validationKey()])

pascalbaljet commented 7 months ago

Unable to debug without a code example.