for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Containers\Authorization\UI\API\Requests;
use App\Ship\Parents\Requests\Request;
/**
* Class SyncPermissionOnRoleRequest.
*
* @author Mahmoud Zalt <[email protected]>
*/
class SyncPermissionOnRoleRequest extends Request
{
* Define which Roles and/or Permissions has access to this request..
* @var array
protected $access = [
'roles' => 'admin',
'permissions' => '',
];
* Id's that needs decoding before applying the validation rules.
protected $decode = [
'permissions_ids',
'role_id',
* Defining the URL parameters (`/stores/999/items`) allows applying
* validation rules on them and allows accessing them like request data.
protected $urlParameters = [
* @return array
public function rules()
return [
'permissions_ids' => 'required',
'permissions_ids.*' => 'exists:permissions,id',
'role_id' => 'required|exists:roles,id',
}
* @return bool
public function authorize()
return $this->hasAccess();