first commit
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyContent;
|
||||
|
||||
use App\Core\Repository\PropertyContent\PropertyContentRepository;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PropertyContentCreateValidator extends BaseValidator
|
||||
{
|
||||
private $propertyContentRepository;
|
||||
|
||||
public function __construct
|
||||
(
|
||||
PropertyContentRepository $propertyContentRepository,
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
$this->propertyContentRepository = $propertyContentRepository;
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
'property_id' => 'required',
|
||||
'content_category_id' => 'required',
|
||||
'locale' => 'required|string|max:2',
|
||||
'status' => 'required|integer|max:4',
|
||||
'created_by' => 'required|integer',
|
||||
'updated_by' => 'required|integer',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
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