for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the HRis Software package.
*
* NOTICE OF LICENSE
* Licensed under the 3-clause BSD License.
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file.
* @version alpha
* @author Bertrand Kintanar <[email protected]>
* @license BSD License (3-clause)
* @copyright (c) 2014-2016, b8 Studios, Ltd
* @link http://github.com/HB-Co/HRis
*/
namespace HRis\Api\Requests\Profile;
use Irradiate\Api\Requests\Request;
/**
* Class ReportsToRequest.
class ReportsToRequest extends Request
{
* Get the validation rules that apply to the request.
* @return array
public function rules()
if ($this->isMethod('post') || $this->isMethod('patch')) {
return [
'employee_id' => [
'required',
'unique_with:employee_supervisors,supervisor_id',
],
'supervisor_id' => [
'unique_with:employee_supervisors,employee_id',
'different:employee_id',
];
}
return [];
* Determine if the user is authorized to make this request.
* @return bool
public function authorize()
$permission = $this->is('*pim/*') ? 'pim.reports-to' : 'profile.reports-to';
return $this->hasAccess($permission);