matrix-choice

Installation

Install Lara Zeus Matrix Choice by running the following commands in your Laravel project directory.

1composer require lara-zeus/matrix-choice

Usage:

use it in your resource

1Matrix::make('question')
2 ->label('Tell us about your mod')
3 ->asRadio()
4 // or
5 ->asCheckbox()
6 ->columnData([
7 'c' => 'Create',
8 'r' => 'Read',
9 'u' => 'Update',
10 'd' => 'Delete',
11 'm' => 'Manage',
12 'p' => 'Approve',
13 ])
14 ->rowData([
15 'users' => 'Users',
16 'companies' => 'Companies',
17 'clients' => 'Clients',
18 ])
19 
20 //set the row selection optional
21 ->rowSelectRequired(false)
22 
23 // to disable any options:
24 ->disableOptionWhen(fn (string $value): bool => $value === 'm' || $value === 'p' || $value === 'users')
25 ,

Zeus is an open-source project. Thanks to my sponsors for helping me maintain this project.