for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Microboard\Http\Controllers;
use Microboard\DataTables\RoleDataTable;
use Microboard\Http\Requests\Role\StoreFormRequest;
use Microboard\Http\Requests\Role\UpdateFormRequest;
use Microboard\Models\Role;
class RoleController extends ResourceController
{
protected array $indexWidgets = [
'\Microboard\Widgets\PopularRole' => [
'size' => 'col-md-4'
],
'\Microboard\Widgets\PermissionsCount' => [
'\Microboard\Widgets\DefaultRole' => [
];
/**
* Role has been created.
*
* @param StoreFormRequest $request
* @param Role $model
*/
protected function created($request, $model)
$model->permissions()->attach($request->get('permissions'));
}
* Role has been updated.
* @param UpdateFormRequest $request
protected function updated($request, $model)
$model->permissions()->sync($request->get('permissions'));
* @return string
protected function getModel(): string
return Role::class;
protected function getDatatable(): string
return RoleDataTable::class;
protected function getStoreFormRequest(): string
return StoreFormRequest::class;
protected function getUpdateFormRequest(): string
return UpdateFormRequest::class;