1. Go to this page and download the library: Download yadahan/nova-bouncer 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/ */
yadahan / nova-bouncer example snippets
public function tools()
{
return [
// ...
new \Yadahan\BouncerTool\BouncerTool,
];
}
use Laravel\Nova\Fields\MorphToMany;
use Laravel\Nova\Fields\Text;
public function fields(Request $request)
{
return [
// ...
MorphToMany::make('Roles', 'roles', 'Yadahan\BouncerTool\Nova\Role')->fields(function () {
return [
Text::make('Scope')
->sortable()
->rules('nullable', 'integer'),
];
}),
MorphToMany::make('Abilities', 'abilities', 'Yadahan\BouncerTool\Nova\Ability')
->fields(new \Yadahan\BouncerTool\Nova\PermissionsFields),
];
}