first commit
This commit is contained in:
47
app/Core/Validator/PropertyAddon/PropertyAddonValidator.php
Normal file
47
app/Core/Validator/PropertyAddon/PropertyAddonValidator.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyAddon;
|
||||
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
use Exception;
|
||||
use App\Core\Validator\BaseValidator;
|
||||
use App\Models\PropertyPlace;
|
||||
|
||||
class PropertyAddonValidator extends BaseValidator
|
||||
{
|
||||
|
||||
public function __construct
|
||||
(
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return
|
||||
[
|
||||
"property_id" => 'required|numeric',
|
||||
"channel_id" => 'required|numeric',
|
||||
"property_addon_id" => 'required|numeric',
|
||||
'type' => 'required_without:status|in:ONT,PRP',
|
||||
'amount' => 'required_without:status|numeric',
|
||||
'status' => 'nullable|numeric'
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return parent::messages();
|
||||
}
|
||||
|
||||
|
||||
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