PHP code example of daikazu / filament-image-checkbox-group
1. Go to this page and download the library: Download daikazu/filament-image-checkbox-group library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
daikazu / filament-image-checkbox-group example snippets
ImageCheckboxGroup::make('amenities')
->options([...])
->gridColumns(4) // Will create a responsive grid that grows up to 4 columns
ImageCheckboxGroup::make('amenities')
->options([...])
->gridColumns([
'default' => 1, // mobile first (xs breakpoint)
'sm' => 2, // small screens (640px)
'md' => 3, // medium screens (768px)
'lg' => 4, // large screens (1024px)
'xl' => 6, // extra large screens (1280px)
'2xl' => 8, // 2xl screens (1536px)
])
ImageCheckboxGroup::make('amenities')
->options([...])
->gridColumns([
'default' => 1, // 1 column on mobile
'md' => 3, // 3 columns from medium screens up
'xl' => 4, // 4 columns from extra large screens up
])
ImageCheckboxGroup::make('amenities')
->options([
'wifi' => [
'label' => 'Wi-Fi',
'image' => asset('images/amenities/wifi.jpg'),
],
'parking' => [
'label' => 'Parking',
'image' => asset('images/amenities/parking.jpg'),
],
'pool' => [
'label' => 'Swimming Pool',
'image' => asset('images/amenities/pool.jpg'),
],
])
->minSelect(1) // Must select at least 1
->maxSelect(2) // Cannot select more than 2
->