PHP code example of mmerlijn / nova-checkboxes-field
1. Go to this page and download the library: Download mmerlijn/nova-checkboxes-field 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/ */
mmerlijn / nova-checkboxes-field example snippets
use \mmerlijn\NovaCheckboxesField\Checkboxes;
Checkboxes::make('Roles')->options([
1 => 'Admin',
2=> 'Super user',
]);
public function setPermissionArrayAttribute(array $value)
{
$this->permissions()->sync($value);
}
public function getPermissionArrayAttribute()
{
return $this->permissions->map(fn($item) => $item->pivot->permission_id)->toArray();
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.