restore composer.json, add mysqli extension

This commit is contained in:
2026-04-15 17:02:52 +05:00
commit 77cf56a348
4317 changed files with 1397107 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests\Site\Cart;
use Illuminate\Foundation\Http\FormRequest;
class CartStoreRequest extends FormRequest
{
/**
* @return array
*/
public function rules()
{
return [
'product_id' => 'required|exists:products,id',
'count' => 'required|numeric'
];
}
/**
* @return mixed
*/
public function getSize()
{
if ($this->get('size')) {
return $this->get('size');
}
return $this->get('size');
}
}

View File

@@ -0,0 +1,90 @@
<?php
namespace App\Http\Requests\Site\Checkout;
use Illuminate\Foundation\Http\FormRequest;
class StoreRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
if ($this->isMethod('post')) {
return [
'delivery_type' => 'required',
'payment_type' => 'required|in:cash,payme,apelsin,click,uzcard,humo',
'products' => 'array|required',
];
}
return [];
}
protected function getValidatorInstance() {
$validator = parent::getValidatorInstance();
if ($this->isMethod('post')) {
$validator->sometimes('address.region_id', 'required', function($input) {
return $input->delivery_type == 'delivery';
});
$validator->sometimes('address.city_id', 'required', function($input) {
return $input->delivery_type == 'delivery';
});
$validator->sometimes('address.address', 'required', function($input) {
return $input->delivery_type == 'delivery';
});
$validator->sometimes('address.first_name', 'required', function($input) {
return $input->delivery_type == 'delivery';
});
}
return $validator;
}
/**
* @return int
*/
public function getPaymentStatus()
{
if ($this->get('payment_type') === 'cash') {
return 'cash';
}
return 'waiting';
}
/**
* @return mixed|null
*/
public function getShipmentDate()
{
if ($this->get('shipment_date')) {
return $this->get('shipment_date');
}
return null;
}
/**
* @return mixed|null
*/
public function getBranchID()
{
if ($this->get('branch_id')) {
return $this->get('branch_id');
}
return null;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Http\Requests\Site\Comment;
use Illuminate\Foundation\Http\FormRequest;
class CommentCreateRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'first_name' => 'required|string',
'body' => 'required|string',
'star' => 'required|numeric',
'product_id' => 'required|numeric|exists:products,id'
];
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Http\Requests\Site\Feedback;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Str;
class Create extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|string',
'phone' => [
'required',
'string',
'regex:/(\+998) (90|91|92|93|94|95|96|97|98|99|33|88) [0-9]{3} [0-9]{2} [0-9]{2}/',
],
'message' => 'required|string'
];
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Http\Requests\Site\Product;
use App\Rules\Auth\Phone;
use Illuminate\Foundation\Http\FormRequest;
class BuyOneClickRequest extends FormRequest
{
/**
*
*/
public function prepareForValidation()
{
$this->merge([
'phone' => str_replace(['+', '(', ')', '-', ' '], '', $this->phone),
]);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'product_id' => 'required',
'phone' => [
'required',
'string',
'regex:/(998)(90|91|92|93|94|95|96|97|98|99)[0-9]{7}/',
],
];
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Http\Requests\Site\Product;
use Illuminate\Foundation\Http\FormRequest;
class CreditRequest extends FormRequest
{
public function prepareForValidation()
{
$this->merge([
'phone' => str_replace(['+', '(', ')', '-', ' '], '', $this->phone),
]);
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
if ($this->isMethod('get')) {
return [];
}
return [
'phone' => [
'required',
'string',
'regex:/(998)(90|91|92|93|94|95|96|97|98|99|33|88)[0-9]{7}/',
],
'code' => 'required|numeric|min:6'
];
}
/**
* @return int
*/
public function getPhone(): int
{
return (int) str_replace(['+', '(', ')', '-', ' '], '', $this->get('phone'));
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Http\Requests\Site\Profile;
use App\Rules\MatchOldPassword;
use Illuminate\Foundation\Http\FormRequest;
class ChangePasswordRequest extends FormRequest
{
public function rules()
{
return [
'current_password' => ['required', new MatchOldPassword],
'password' => 'required|confirmed|min:6'
];
}
public function messages()
{
return [
'password.confirmed' => trans('vue.login.confirmed'),
'password.min' => trans('vue.login.min')
];
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Http\Requests\Site\Profile;
use Illuminate\Foundation\Http\FormRequest;
class Update extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'first_name' => 'required'
];
}
}