first commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyBookingTicket;
|
||||
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
|
||||
class PropertyTicketCreateValidator extends BaseValidator
|
||||
{
|
||||
public function __construct
|
||||
(
|
||||
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return [
|
||||
'user_id' => 'nullable|numeric',
|
||||
'booking_code' => 'required|string|min:18|max:18',
|
||||
'message' => 'required|string|max:2000',
|
||||
'is_note' => 'nullable|boolean',
|
||||
'ip_address' => 'required|ip',
|
||||
];
|
||||
}
|
||||
|
||||
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,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core\Validator\PropertyBookingTicket;
|
||||
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
|
||||
use App\Core\Validator\BaseValidator;
|
||||
|
||||
|
||||
class PropertyTicketGetValidator extends BaseValidator
|
||||
{
|
||||
|
||||
public function __construct
|
||||
(
|
||||
|
||||
Translator $translator,
|
||||
Container $container
|
||||
)
|
||||
{
|
||||
parent::__construct($translator, $container);
|
||||
|
||||
}
|
||||
|
||||
public function rules($params = null)
|
||||
{
|
||||
return [
|
||||
'user_id' => 'nullable|numeric',
|
||||
'booking_code' => 'required|string|min:18|max:18',
|
||||
];
|
||||
}
|
||||
|
||||
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