first commit
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyExecutive;
|
||||
|
||||
use App\Core\Repository\PropertyExecutive\PropertyExecutiveRepository;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyExecutiveCreateValidator extends BaseValidator
|
||||
{
|
||||
private $propertyExecutiveRepository;
|
||||
|
||||
public function __construct
|
||||
(
|
||||
PropertyExecutiveRepository $propertyExecutiveRepository,
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
$this->propertyExecutiveRepository = $propertyExecutiveRepository;
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'property_id' => 'required|numeric',
|
||||
'executive_type_id' => 'required|numeric',
|
||||
'name_surname' => 'required|max:50',
|
||||
'email' => 'nullable|email|max:100',
|
||||
'extension' => 'nullable|max:10',
|
||||
'phone' => 'nullable|max:50',
|
||||
'mobile' => 'nullable|max:50',
|
||||
'fax' => 'nullable|max:50',
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages() , $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyExecutive;
|
||||
|
||||
use App\Core\Repository\PropertyExecutive\PropertyExecutiveRepository;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyExecutiveUpdateValidator extends BaseValidator
|
||||
{
|
||||
private $propertyExecutiveRepository;
|
||||
|
||||
public function __construct
|
||||
(
|
||||
PropertyExecutiveRepository $propertyExecutiveRepository,
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
$this->propertyExecutiveRepository = $propertyExecutiveRepository;
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'executive_type_id' => 'required|numeric',
|
||||
'name_surname' => 'required|max:50',
|
||||
'email' => 'nullable|email|max:100',
|
||||
'extension' => 'nullable|max:10',
|
||||
'phone' => 'nullable|max:50',
|
||||
'mobile' => 'nullable|max:50',
|
||||
'fax' => 'nullable|max:50',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
$thisMessages = [];
|
||||
return array_merge(parent::messages() , $thisMessages);
|
||||
}
|
||||
|
||||
|
||||
public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
return $this->make($params, $this->rules($params), $this->messages());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user