first commit

This commit is contained in:
ExtraNetwork
2026-05-12 17:04:54 +03:00
commit e5c4b6aa13
1425 changed files with 284735 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Core\Validator\Property;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use App\Core\Validator\BaseValidator;
class PropertyBrandAddValidator extends BaseValidator
{
public function __construct
(
Translator $translator,
Container $container
)
{
parent::__construct($translator, $container);
}
public function rules($params = null)
{
return
[
'property_id' => 'required|numeric',
'title' => 'nullable|json',
'color_codes' => 'nullable|json',
];
}
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());
}
}

View File

@@ -0,0 +1,48 @@
<?php
namespace App\Core\Validator\Property;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use App\Core\Validator\BaseValidator;
class PropertyBrandPhotoValidator extends BaseValidator
{
public function __construct
(
Translator $translator,
Container $container
)
{
parent::__construct($translator, $container);
}
public function rules($params = null)
{
return
[
'photo' => 'nullable|mimes:jpg,jpeg,png,webp,gif|max:10240',
];
}
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());
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Core\Validator\Property;
use App\Core\Repository\Property\PropertyRepository;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use App\Core\Validator\BaseValidator;
use Exception;
class PropertyCreateValidator extends BaseValidator
{
private $propertyRepository;
public function __construct
(
PropertyRepository $propertyRepository,
Translator $translator,
Container $container
)
{
parent::__construct($translator, $container);
$this->propertyRepository = $propertyRepository;
}
public function rules($params = null)
{
return
[
'name' => 'required|min:3'
];
}
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());
}
}

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Core\Validator\Property;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use App\Core\Validator\BaseValidator;
class PropertyLocationUpdateValidator extends BaseValidator
{
public function __construct
(
Translator $translator,
Container $container
)
{
parent::__construct($translator, $container);
}
public function rules($params = null)
{
return
[
'address' => 'nullable|string|max:200',
'latitude' => 'nullable',
'longitude' => 'nullable',
];
}
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());
}
}

View File

@@ -0,0 +1,48 @@
<?php
namespace App\Core\Validator\Property;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use App\Core\Validator\BaseValidator;
class PropertyPhotoValidator extends BaseValidator
{
public function __construct
(
Translator $translator,
Container $container
)
{
parent::__construct($translator, $container);
}
public function rules($params = null)
{
return
[
'photo' => 'nullable|mimes:jpg,jpeg,png,webp|max:10240',
];
}
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());
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Core\Validator\Property;
use App\Core\Repository\Property\PropertyRepository;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use App\Core\Validator\BaseValidator;
use Exception;
class PropertySearchValidator extends BaseValidator
{
private $PropertyRepository;
public function __construct
(
PropertyRepository $PropertyRepository,
Translator $translator,
Container $container
)
{
parent::__construct($translator, $container);
$this->PropertyRepository = $PropertyRepository;
}
public function rules($params = null)
{
return
[
'name' => 'required|min:3'
];
}
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());
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace App\Core\Validator\Property;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use App\Core\Validator\BaseValidator;
use Exception;
use Illuminate\Support\Facades\Log;
class PropertyUpdateValidator extends BaseValidator
{
public function __construct
(
Translator $translator,
Container $container
)
{
parent::__construct($translator, $container);
}
public function rules($params = null)
{
$return =
[
'property_info.name' => 'required|min:3|max:255',
'property_info.property_type_id' => 'required|numeric',
'property_info.chain_id' => 'required|numeric',
'property_info.official_name' => 'nullable|min:3|max:255',
'property_info.country' => 'required|max:5',
'property_info.tax_office' => 'nullable|min:3|max:255',
'property_info.tax_number' => 'nullable|min:2|max:255',
'property_info.checkin_time' => 'nullable|min:3|max:100',
'property_info.checkout_time' => 'nullable|min:2|max:100',
'additional_info' => 'array',
'additional_info.*.year_construction' => 'nullable|string|max:100',
'additional_info.*.year_renovation' => 'nullable|string|max:100',
];
if (isset($params['additional_info']['locale_name_language']) || isset($params['additional_info']['locale_name'])) {
if ( !empty($params['additional_info']['locale_name_language']) || !empty($params['additional_info']['locale_name'])) {
$return['additional_info.locale_name_language'] = 'required|min:2|max:100';
$return['additional_info.locale_name'] = 'required';
}
}
return $return;
}
public function messages()
{
// use example 'validation.input' => __('validation_type', ['input' => __('input form language key')]),
// validation types in baseValidator switch-case block
$thisMessages = [
'property_info.name.required' => __('error-input-required', ['input' => __('input-property_name')]),
'property_info.name.min' => __('error-input-min', ['input' => __('input-property_name')]),
];
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());
}
}