Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c894471e5 | |||
| d2fc561c03 | |||
| 9d940dd1b9 | |||
| 2dc250669e | |||
| 2cc49234e4 | |||
| 38db78573c | |||
| 48409575a9 |
+34
-28
@@ -4,36 +4,55 @@ APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_LOCALE=en
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
# APP_MAINTENANCE_STORE=database
|
||||
|
||||
# PHP_CLI_SERVER_WORKERS=4
|
||||
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=127.0.0.1
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=laravel
|
||||
# DB_USERNAME=root
|
||||
# DB_PASSWORD=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=120
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
BROADCAST_CONNECTION=log
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=database
|
||||
|
||||
CACHE_STORE=database
|
||||
# CACHE_PREFIX=
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_CLIENT=phpredis
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=mailpit
|
||||
MAIL_PORT=1025
|
||||
MAIL_MAILER=log
|
||||
MAIL_SCHEME=null
|
||||
MAIL_HOST=127.0.0.1
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
@@ -43,17 +62,4 @@ AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_HOST=
|
||||
PUSHER_PORT=443
|
||||
PUSHER_SCHEME=https
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
+15
-10
@@ -1,19 +1,24 @@
|
||||
*.log
|
||||
.DS_Store
|
||||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpactor.json
|
||||
.phpunit.result.cache
|
||||
/.fleet
|
||||
/.idea
|
||||
/.nova
|
||||
/.phpunit.cache
|
||||
/.vscode
|
||||
/.zed
|
||||
/auth.json
|
||||
/node_modules
|
||||
/public/build
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/storage/pail
|
||||
/vendor
|
||||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpunit.result.cache
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
auth.json
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/.fleet
|
||||
/.idea
|
||||
/.vscode
|
||||
Thumbs.db
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Console;
|
||||
|
||||
use Error;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use App\Console\Commands\BaseScheduleCommand;
|
||||
use App\Mail\BaseMailerObj;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Mail\Mailer;
|
||||
use Modules\Taxi\App\Models\TaxiMain;
|
||||
use DateTime;
|
||||
|
||||
class SendOrdersToTaxiCommand extends BaseScheduleCommand
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*/
|
||||
public $signature = 'taxi:send';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*/
|
||||
public $description = 'Отправка заказов такси на сегодня агрегаторам';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->executeCommand(function () {
|
||||
$todayOrders = TaxiMain::where('cancel_rqst', 0)
|
||||
->where('taxi_date', (new DateTime())->format('Y-m-d'))
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
if (!$todayOrders) {
|
||||
Mail::send(new Mailer(
|
||||
new BaseMailerObj(
|
||||
|
||||
)
|
||||
));
|
||||
echo '<pre>'; var_dump('da'); echo'</pre>';
|
||||
} else {
|
||||
echo '<pre>'; var_dump('net'); echo'</pre>';
|
||||
}
|
||||
|
||||
throw new Error('Ошипка!');
|
||||
}, 'еще инва');
|
||||
|
||||
// try {
|
||||
// throw new Error('Ошипка!');
|
||||
// } catch (\Throwable $th) {
|
||||
// \Log::channel('schedule_err')->error($th->getFile() . ": " . $th->getMessage() . " Line: " . $th->getLine());
|
||||
// }
|
||||
|
||||
//$this->info('Daily report generated at ' . now());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command arguments.
|
||||
*/
|
||||
protected function getArguments(): array
|
||||
{
|
||||
return [
|
||||
['example', InputArgument::REQUIRED, 'An example argument.'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*/
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\DTO;
|
||||
|
||||
use Modules\Taxi\App\Http\Requests\TaxiOrderRequest;
|
||||
|
||||
/**
|
||||
* Класс для формирования DTO с данными по заказу на такси
|
||||
*/
|
||||
class TaxiOrderDTO
|
||||
{
|
||||
public function __construct(
|
||||
public readonly int | null $id,
|
||||
public readonly string | null $emp_login,
|
||||
public readonly string $emp_phone,
|
||||
public readonly string $taxi_date,
|
||||
public readonly string $taxi_time,
|
||||
public readonly string $taxi_address_from,
|
||||
public readonly string $taxi_address_to,
|
||||
public readonly int $cancel_rqst = 0,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Метод формирования DTO с данными по заказу такси
|
||||
*
|
||||
* По сути, простой сеттер, позволяющий создать для обрабатываемого объекта данных экземпляр класса для более удобного взаимодействия с ним, более стандартизированного и более надежного (так как все параметры прописаны в одном месте)
|
||||
* Использование self позволяет нам не зависеть от названия текущего класса, если мы захотим его переименовать
|
||||
*
|
||||
* @param TaxiOrderRequest $rqst запрос с валидными данными по заказу, пришедшими с фронта
|
||||
* @param string $rqstMethod метод обрабатываемого запроса. Обновление или создание, например
|
||||
* @return self
|
||||
*/
|
||||
public static function setTaxiOrderDTO(TaxiOrderRequest $rqst, string $rqstMethod): self
|
||||
{
|
||||
$validated = $rqst->validated();
|
||||
|
||||
switch ($rqstMethod) {
|
||||
case 'PATCH':
|
||||
return new self(
|
||||
id: $validated['id'],
|
||||
//При обновлении запроса логин пользователя должен оставаться неизменным
|
||||
emp_login: $rqst->emp_login,
|
||||
emp_phone: $validated['emp_phone'],
|
||||
taxi_date: $validated['taxi_date'],
|
||||
taxi_time: $validated['taxi_time'],
|
||||
taxi_address_from: $validated['taxi_address_from'],
|
||||
taxi_address_to: $validated['taxi_address_to'],
|
||||
cancel_rqst: $validated['cancel_rqst'] ?? null,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
return new self(
|
||||
id: $validated['id'] ?? null,
|
||||
emp_login: $validated['emp_login'],
|
||||
emp_phone: $validated['emp_phone'],
|
||||
taxi_date: $validated['taxi_date'],
|
||||
taxi_time: $validated['taxi_time'],
|
||||
taxi_address_from: $validated['taxi_address_from'],
|
||||
taxi_address_to: $validated['taxi_address_to'],
|
||||
cancel_rqst: $validated['cancel_rqst'] ?? null,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,351 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Taxi\App\Models as TaxiModels;
|
||||
use App\Models\OldMagicModels;
|
||||
#Гаврилов
|
||||
//Rule и Validatir НЕ НУЖЕН? ЕСЛИ МЫ ВАЛИДИРУЕМ В ОТДЕЛЬОМ FORM_REQUEST
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Modules\Taxi\App\Http\Requests\TaxiOrderRequest;
|
||||
#Гаврилов
|
||||
//КЛАСС НИЖЕ НЕ НУЖЕН, ТАК КАК ИСПОЛЬЗУЕМ СЕРВИС?
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Modules\Taxi\App\Services\TaxiOrderService;
|
||||
use Modules\Taxi\App\Services\TaxiMailerService;
|
||||
use Modules\Taxi\App\DTO\TaxiOrderDTO;
|
||||
use Modules\Taxi\App\Jobs\SendMailNewOrder;
|
||||
//use Illuminate\Support\Facades\Config;
|
||||
use App\Mail\Mailer;
|
||||
use DateTime;
|
||||
use Error;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Taxi\App\Mail\NewOrderMail;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
use App\Facades\RedisNotifications;
|
||||
|
||||
|
||||
class TaxiController extends Controller
|
||||
{
|
||||
/**
|
||||
* Конструктор
|
||||
*
|
||||
* @param TaxiMailerService $sendMailService сервис отправки писем
|
||||
* @param TaxiOrderService $orderService сервис работы с заказами
|
||||
*/
|
||||
public function __construct(protected TaxiMailerService $sendMailService, protected TaxiOrderService $orderService) {}
|
||||
|
||||
|
||||
/**
|
||||
* Получаем информацию по существующему заказу
|
||||
*
|
||||
* @param integer $orderId идентификатор заказа
|
||||
*/
|
||||
public function getOrderById(int $orderId)
|
||||
{
|
||||
$taxiOrder = TaxiModels\TaxiMain::where('id', $orderId)->first();
|
||||
|
||||
return $taxiOrder;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Получение адресов офисов для подстановки в запросы такси
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOfficeAddress()
|
||||
{
|
||||
$taxiAddress = TaxiModels\OfficeAddress::all();
|
||||
|
||||
return $taxiAddress;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Получение всех активных заказов
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getActiveOrders()
|
||||
{
|
||||
$todaydate = new DateTime();
|
||||
$todaydate->setTime(00, 00, 00);
|
||||
$todaydate = $todaydate->format('Y-m-d');
|
||||
$orders = TaxiModels\TaxiMain::where('taxi_date', '>=', $todayFdate)
|
||||
->get();
|
||||
|
||||
return $orders;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Метод получения заказов по условиям фильтра
|
||||
*
|
||||
* @param Request $rqst запрос с параметрами поиска
|
||||
* @return string
|
||||
*/
|
||||
public function getFilterOrders(Request $rqst)
|
||||
{
|
||||
$rqstCond = [];
|
||||
foreach ($rqst->all() as $fieldName => $fieldVal) {
|
||||
if (!$fieldVal) continue;
|
||||
$rqstCond[] = [$fieldName, '=', $fieldVal];
|
||||
}
|
||||
$filterRqst = TaxiModels\TaxiMain::where($rqstCond)->get();
|
||||
|
||||
return json_encode($filterRqst->toArray());
|
||||
}
|
||||
|
||||
|
||||
//ГАВРИЛОВ используй транзакцию, а то создается запрос, не отправляется письмо и сообщение об ошибке
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function createTaxiOrder(TaxiOrderRequest $rqst)
|
||||
{
|
||||
$validateData = TaxiOrderDTO::setTaxiOrderDTO($rqst, $rqst->method());
|
||||
//Пытаемся найти уже существующий запрос на этот же логин и эту же дату. Если запрос найден, возвращаем ошибку.
|
||||
$searchExistsOrder = TaxiModels\TaxiMain::where([
|
||||
['emp_login', '=', $validateData->emp_login],
|
||||
['taxi_date', '=', $validateData->taxi_date]
|
||||
])->take(1)->get();
|
||||
if (count($searchExistsOrder)) {
|
||||
return response()->json(['message' => "Ошибка! Заявка для сотрудника $validateData->emp_login на дату $validateData->taxi_date уже существует"], 400);
|
||||
}
|
||||
// $createRqstMsg;
|
||||
try {
|
||||
$newOrderId = (new TaxiModels\TaxiMain())->createOrder($validateData);
|
||||
//$newOrderId = $this->orderService->createOrder($validateData);
|
||||
$createRqstMsg = "Заявка успешно создана. Номер $newOrderId";
|
||||
#Гаврилов
|
||||
//ПРОВЕРЬ, ЧТОБЫ ПИСЬМО НЕ ОТПРАВЛЯЛОСЬ, ЕСЛИ ВОЗНИКАЕТ ОШИБКА НА ЭТАПЕ СОЗДАНИЯ ЗАЯВКИ
|
||||
//Один метод отправки письма для всех методов работы с заказом: создание, редактирование, отмена
|
||||
$this->sendMailService->sendMail(new NewOrderMail($validateData, $newOrderId));
|
||||
// SendMailNewOrder::dispatch(json_decode(json_encode($validateData), true), $newOrderId)->onQueue('emails')->delay(10);
|
||||
// Mail::send(new Mailer(
|
||||
// [$validateData->emp_login],
|
||||
// 'Создание заказа на такси',
|
||||
// "Для вас создана заявка на заказ такси на дату <b>{$validateData->taxi_date}</b> и время <b>{$validateData->taxi_time}</b>. Номер заказа <b>{$newOrderId}</b>",
|
||||
// #Гаврилов
|
||||
// //ЗДЕСЬ НЕПОНЯТНО ОТКУДА ВЗЯТЬ ЗНАЧЕНИЕ. ОБРАТИТЬСЯ К ЛОКАЛЬНО МОДУЛЬНОМУ ENV?
|
||||
// config('taxi.name_ru'),
|
||||
// ));
|
||||
return response()->json(['message' => "Заявка успешно создана. Номер заявки $newOrderId"]);
|
||||
} catch (\Throwable $t) {
|
||||
#Гаврилов
|
||||
//ОТПРАВКА СООБЩЕНИЯ С ОШИБКОЙ. ЗАТЕСТИ и отправляй response
|
||||
//ОШИБКИ $T->GETmESSAGE НУЖНО ЛОГИРОВАТЬ, НО ПОЛЬЗОВАТЕЛЯМ ВЫВОДИТЬ ПРОСТО СООБЩЕНИЕ "оШИБКА", ИНАЧЕ ОНИ ВИДЯТ ТЕХНиЧЕСКИЙ ТЕКСТ
|
||||
//СНАЧАЛА ПЕРЕХВАТЫЙ EXCEPTION, ПОТОМ УЖЕ THOWBLE. ТЕКСТ ИЗ EXCEPTION ВЫВОДИ ПОЛЬЗОВАТЕЛЮ - ТАМ КАСТОМНЫЕ ТЕКСТ ОШИБКИ, А ТЕКСТ ИЗ THORWBLE ЛОГИРУЙ ОТДЕЛЬНО, ТАК КАК ТАМ ТЕХНИЧЕСКОЕ ОПИСАНИЕ ОШИБКИ
|
||||
echo '<pre>';
|
||||
var_dump($t->getMessage());
|
||||
echo '</pre>';
|
||||
echo '<pre>';
|
||||
var_dump($t->getTrace());
|
||||
echo '</pre>';
|
||||
$createRqstMsg = "Ошибка!" . $t->getMessage() . ". Заявка не создана";
|
||||
return response()->json(['message' => $createRqstMsg], 400);
|
||||
}
|
||||
|
||||
//ГАВРИЛОВ
|
||||
//ДОБАВЬ ФОРМИРОВАНИЕ ОТВЕТА ЧЕРЕЗ ApiResponder, а не через response()
|
||||
}
|
||||
|
||||
|
||||
#Гаврилов
|
||||
//ИСПОЛЬЗУЙ TaxiOrderRequest ПРИ ОБРАБОТКЕ ЗАЯВОК НА ТАКСИ
|
||||
|
||||
/**
|
||||
* Метод отмены запроса
|
||||
*
|
||||
* @param integer $rqstId идентификатор запроса
|
||||
* @return string
|
||||
*/
|
||||
public function cancelRqst(int $rqstId): string
|
||||
{
|
||||
#Гаврилов
|
||||
//ПОПРОБУЙ ОТПРАВИТЬ ЗАПРОС К API ЕНДПОИНТУ (ОТМЕНА ЗАПРОСА НА ТАКСИ) ЧЕРЕЗ POSTMAN С ПЕРЕДАЧЕЙ ЗАГОЛОВКА АУТЕНТИФИКАЦИИ С SANCTUM ТОКЕНОМ. ДОЛЖЕН ПРОПУСТИТЬ, А БЕЗ ЗАГОЛОВКА НЕ ДОЛЖЕН
|
||||
$rqstData = $this->getOrderById($rqstId);
|
||||
try {
|
||||
#Гаврилов
|
||||
//ПЕРЕНЕСИ ЭТУ ПРОВЕРКУ В РОУТИНГ? FINDORFAIL С РЕДИРЕКТОМ И ОШИБКОЙ
|
||||
if (!$rqstData) {
|
||||
throw new \Exception("Запрос $rqstId не существует");
|
||||
}
|
||||
if (!$this->checkRqstDate($rqstData->taxi_date)) {
|
||||
throw new \Exception("Дата запроса $rqstId уже прошла");
|
||||
}
|
||||
} catch (\Throwable $t) {
|
||||
return response()->json([
|
||||
'errorMsg' => "Ошибка: $t->getMessage(). Заявка не отменена",
|
||||
], 400);
|
||||
}
|
||||
|
||||
$rqstData['cancel_rqst'] = 1;
|
||||
$rqstData->save();
|
||||
|
||||
$this->sendMailService->sendCancelOrderMail($validateData, $newOrderId);
|
||||
|
||||
// Mail::send(new Mailer(
|
||||
// [$rqstData->emp_login],
|
||||
// 'Отмена заказа на такси',
|
||||
// "Заказ номер $rqstId на дату $rqstData->taxi_date и время $rqstData->taxi_time отменен",
|
||||
// $this->appName));
|
||||
|
||||
return redirect('/taxi/home')->with([
|
||||
'notification' => "Запрос $rqstId отменен",
|
||||
'notification_err' => false
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Проверяем находится ли дата запроса на такси в диапазоне сегодняшнего или завтрашнего дня.
|
||||
*
|
||||
* @param string $rqstDate дата запроса на такси
|
||||
* @return boolean
|
||||
*/
|
||||
private function checkRqstDate($rqstDate): bool
|
||||
{
|
||||
$todaydate = new DateTime();
|
||||
$todaydate->setTime(00, 00, 00);
|
||||
|
||||
return new DateTime($rqstDate) >= $todaydate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Получаем временные промежутки
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTimePeriods()
|
||||
{
|
||||
$empAllData = TaxiModels\TaxiTimePeriod::select('time_period', 'is_morning_time')
|
||||
->where('archive', 0)
|
||||
->get();
|
||||
|
||||
return $empAllData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Метод получает информацию по всем активным пользователям
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getActiveUsersInfo()
|
||||
{
|
||||
$empAllData = OldMagicModels\CcEmp::whereIn('emp_area', ['Курск', 'Пенза'])
|
||||
->whereNotIn('emp_state', ['Уволен', 'Декрет', 'Перевод на позицию', 'Перевод в ГРАН'])
|
||||
->get();
|
||||
foreach ($empAllData as &$empData) {
|
||||
$empData['full_name'] = $empData['emp_surname'] . " " . $empData['emp_name'] . " " . $empData['emp_surname'];
|
||||
$empData['extension_number'] = $empData['emp_phone'];
|
||||
$empData['emp_phone'] = $empData['emp_mob_phone'];
|
||||
}
|
||||
|
||||
return $empAllData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Метод получает информацию по конкретному пользователю
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getUserInfoByLogin(string $userLogin)
|
||||
{
|
||||
$empLoginData = OldMagicModels\CcEmp::where('emp_login', $userLogin)
|
||||
->get();
|
||||
|
||||
// dd($empLoginData);
|
||||
$empLoginData[0]['full_name'] = $empLoginData[0]['emp_surname'] . " " . $empLoginData[0]['emp_name'] . " " . $empLoginData[0]['emp_surname'];
|
||||
$empLoginData[0]['extension_number'] = $empLoginData[0]['emp_phone'];
|
||||
$empLoginData[0]['emp_phone'] = $empLoginData[0]['emp_mob_phone'];
|
||||
|
||||
return $empLoginData;
|
||||
}
|
||||
|
||||
|
||||
#Гаврилов
|
||||
//НЕ ЗАБУДЬ УДАЛИТЬ
|
||||
public function testRedisMethod()
|
||||
{
|
||||
RedisNotifications::module('taxi')
|
||||
->notifications(['текст1', 'tеуые2'])
|
||||
->types(['error', 'success'])
|
||||
->put();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Обновление заявки на такси
|
||||
*
|
||||
* @param TaxiOrderRequest $rqst информация по измененному запросу
|
||||
* @return response
|
||||
*/
|
||||
public function updateTaxiOrder(TaxiOrderRequest $rqst)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
$orderData = TaxiModels\TaxiMain::lockForUpdate()->find($rqst->id);
|
||||
$oldOrderData = TaxiModels\TaxiMain::find($rqst->id);
|
||||
|
||||
if (!$orderData) {
|
||||
throw new Exception("Заказ номер " . $rqst->id . " не найден");
|
||||
//return response()->json(['message' => 'Заказ номер ' . $rqst->id . ' не найден'], 400);
|
||||
}
|
||||
$editOrderData = TaxiOrderDTO::setTaxiOrderDTO($rqst, $rqst->method());
|
||||
#Гаврилов
|
||||
//НА ДОМАШНЕЙ СТРАНИЦЕ ПОКАЗЫВАТЬ ТОЛЬКО ТЕ ЗАПРОСЫ, ДАТА КОТОРЫХ СЕГОДНЯ ИЛИ ЗАВТРА
|
||||
$dateInterval = (new DateTime())->diff(new DateTime($orderData->taxi_date));
|
||||
if ($dateInterval->format('%R') == '-' && $dateInterval->format('%a') >= 1) {
|
||||
throw new Exception("Нельзя менять заявки, дата которых уже прошла");
|
||||
// return response()->json(['message' => 'Нельзя менять заявки, дата которых уже прошла'], 400);
|
||||
}
|
||||
foreach ($editOrderData as $fieldName => $fieldVal) {
|
||||
if (isset($orderData->$fieldName)) {
|
||||
$orderData[$fieldName] = $fieldVal;
|
||||
}
|
||||
}
|
||||
$orderDataDiff = $orderData->getDirty();
|
||||
if (empty($orderDataDiff)) {
|
||||
throw new Exception("Вы не внесли никаких изменений");
|
||||
//return response()->json(['message' => 'Вы не внесли никаких изменений'], 400);
|
||||
}
|
||||
$orderData->save();
|
||||
$this->sendMailService->sendEditOrderMail($oldOrderData->toArray(), $orderDataDiff, $orderData['id']);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json(['message' => 'Заявка успешно изменена'], 200);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
|
||||
return response()->json(['message' => "Ошибка." . $e->getMessage() . ". Не удалось обновить заявку"], 400);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//ГАВРИЛОВ. ДОБАВЬ БЛОКИРОВКУ В МОМЕНТ ПОЛУЧЕНИЯ ДАННЫХ ПО РЕДАКТИРУЕМОМУ ЗАПРОСУ И ДО МОМЕНТА ЕГО ОБНОВЛЕНИЯ. ЛИБО ЧЕРЕЗ УСТАНОВКУ УРОВНЯ ИЗОЛЯЦИИ
|
||||
|
||||
//ГАВРИЛОВ. ДОБАВЬ В DTO НЕ ОБНУЛЕНИЕ НЕНУЖНЫХД ДАННЫХ, А ПРИНУДИТЕЬНАЯ ИХ УСТАНОВКА. НАПРИМЕР ПРИ ОБНОВЛЕНИИ ЗАПРОСА НА ТАКСИ, УСТАНАВЛИВАТЬ EMP_LOGIN = ПЕРЕДАННОМУ ЗНАЧЕНИЮ, ВЗЯТОМУ ИЗ СУЩЕСТВУЮЩЕГО ЗАПРОСА.
|
||||
|
||||
//Обновляем текущую модель, добавляя туда измененные значения, затем проверяем есть ли измененные значения через getDirty()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//ГАВРИЛОВ. убрать поле Запрос актуален? и при отмене заявки убирать ее из таблицы Активные заявки?
|
||||
|
||||
//гаврилов. СДЕЛАТЬ ВОЗМОЖНОСТЬ ВЫГРУЗИТЬ В ОТЧЕТНОСТЬ ВСЕ ИМЕЮЩИЕСЯ ЗАЯВКИ В CSV ФАЙЛ.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Блокировщик работы с заявками на такси в случае слишком ранееЙ, слишком поздней работы с ресурсом
|
||||
*
|
||||
* Решил блочить рабоут приложения в части работы с заявками в очень ранее или очень позднее время. Это связано с нежеланием валидировать при создании или редактировании заявки передаваемый временной промежуток. Например, если текущее время 22:15, а заявка созается на 22:00.
|
||||
*/
|
||||
class CheckTimeRqstAvailability
|
||||
{
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
#Гаврилов
|
||||
//ПОМЕНЯЙ НА 21 НА РЕЛИЗЕ
|
||||
$maxRqstTime = 23;
|
||||
$minRqstTime = 7;
|
||||
$timezone = new \DateTimeZone('Europe/Moscow');
|
||||
$timeNow = (new \DateTime())->setTimezone($timezone);
|
||||
$timeMax = (new \DateTime())->setTimezone($timezone);
|
||||
$timeMin = (new \DateTime())->setTimezone($timezone);
|
||||
$timeMax->setTime($maxRqstTime, 00, 00);
|
||||
$timeMin->setTime($minRqstTime, 00, 00);
|
||||
|
||||
#Гаврилов
|
||||
//ПОМЕНЯЙ (ПОКА ТАК ДЛЯ ТЕСТИРОВАНИЯ)
|
||||
if (!($timeNow > $timeMin && $timeNow < $timeMax)) {
|
||||
//if (!($timeNow > $timeMin && $timeNow > $timeMax)) {
|
||||
$errMsg = "Работа с заявками на такси заблокирована с $maxRqstTime:00 по 0$minRqstTime:00";
|
||||
#Гаврилов
|
||||
//ПОДУМАТЬ КАКОЙ КОД ЛУЧШЕ ВЕРНУТЬ
|
||||
//Метод expectsJson позволяет определить вызывается ли api роут через ajax/fetch, либо web route.
|
||||
if ($request->expectsJson()) {
|
||||
#Гаврилов
|
||||
//ЗАМЕНИТЬ НА ОТВЕТ ЧЕРЕЗ APIRESPONDER. ТАМ ЛУЧШЕ РЕАЛИЗОВАТЬ ВСЮ КАСТОМНУЮ ЛОГИКУ ГЕНЕРАЦИИ ОТВЕТОВ НА API ЗАПРОСЫ С ФРОНТА
|
||||
return response()->json([
|
||||
'errorMsg' => $errMsg
|
||||
], 400);
|
||||
} else {
|
||||
#Гаврилов
|
||||
//ПРОВЕРЬ КОГДА РЕАЛИЗУЕШЬ ОПОВЕЩЕНИЯ
|
||||
return redirect('/taxi/home')->with([
|
||||
'notification' => $errMsg,
|
||||
'notification_err' => true
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use App\Models\OldMagicModels;
|
||||
use Illuminate\Validation\Rule;
|
||||
use DateTime;
|
||||
|
||||
//Не помню точно, но это считается частью логики ларавель - не моя задумка. Некая сущность, которая через себя пропускает данные запроса, валидируя их. Вроде даже вызывается автоматически при работе с формой. Вызывается сразу в начале передачи данных, поэтому гарантирует, что по всему флоу работы с запросом объект с данными уже валиден для нас
|
||||
class TaxiOrderRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Действия перед валидацией.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
//echo '<pre>'; var_dump($this->all()); echo'</pre>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
//Получаем список активных пользователей
|
||||
$empActiveLogins = OldMagicModels\CcEmp::select('emp_login')
|
||||
->whereNotIn('emp_state', ['Уволен', 'Декрет'])
|
||||
->get()
|
||||
->toArray();
|
||||
//Правила валидации
|
||||
$validationRules = [
|
||||
'id' => [
|
||||
'int'
|
||||
],
|
||||
'taxi_date' => [
|
||||
'date_format:Y-m-d',
|
||||
//Заказ можно создать только на сегодняшний или завтрашний день
|
||||
Rule::in([
|
||||
(new DateTime())->format('Y-m-d'),
|
||||
(new DateTime())->modify('+1 day')->format('Y-m-d')
|
||||
]),
|
||||
],
|
||||
'taxi_time' => [
|
||||
'required',
|
||||
'string',
|
||||
'regex:/^[0-9]{2}:[0-9]{2}$/', //время в формате 00:00
|
||||
],
|
||||
'cancel_rqst' => 'boolean',
|
||||
'emp_phone' => [
|
||||
'required',
|
||||
'int',
|
||||
'regex:/^(7|8)?[0-9]{10}$/'
|
||||
],
|
||||
'emp_login' => [
|
||||
$validationRules['emp_login'] = [
|
||||
'required',
|
||||
'string',
|
||||
'regex:/^[a-z\-]+[0-9]*$/',
|
||||
//Логины ищем среди активных логинов на текущий момент
|
||||
Rule::in(
|
||||
array_map(fn($el) => $el['emp_login'], $empActiveLogins)
|
||||
)
|
||||
],
|
||||
],
|
||||
'taxi_address_from' => [
|
||||
'required',
|
||||
'string',
|
||||
'max: 500'
|
||||
],
|
||||
'taxi_address_to' => [
|
||||
'required',
|
||||
'string',
|
||||
'max: 500'
|
||||
]
|
||||
];
|
||||
|
||||
//Во время создания запроса поле ID не валидируется
|
||||
if ($this->isMethod('POST')){
|
||||
$validationRules['id'] = [
|
||||
'prohibited'
|
||||
];
|
||||
}
|
||||
|
||||
return $validationRules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Переопределение сообщений об ошибках валидации
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'taxi_date.in' => 'Заявку на такси можно завести только на сегодняшний или завтрашний день'
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Mail\Mailer;
|
||||
use App\Mail\BaseMailerObj;
|
||||
use App\Job\BaseJob;
|
||||
use Error;
|
||||
|
||||
/**
|
||||
* Джоба размещения задачи на отправку писем по такси
|
||||
*/
|
||||
class TaxiMailJob extends BaseJob
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct(public BaseMailerObj $jobData)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
Mail::send(new Mailer(
|
||||
$this->jobData
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Mail;
|
||||
use App\Mail\BaseMailerObj;
|
||||
use Modules\Taxi\App\DTO\TaxiOrderDTO;
|
||||
|
||||
/**
|
||||
* Базовый класс отправки письма по заказу такси. Объявляет обязательный к реализации метод формирования данных для отправки.
|
||||
*/
|
||||
abstract class BaseTaxiMail
|
||||
{
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param TaxiOrderDTO $orderData
|
||||
* @param integer|null $orderId идентификатор заказа такси
|
||||
*/
|
||||
public function __construct(
|
||||
public TaxiOrderDTO $orderData,
|
||||
public ?int $orderId
|
||||
){
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Метод формирует объект с данными письма для передачи в джобу
|
||||
*
|
||||
* @return BaseMailerObj базовый класс объекта параметров письма для мейлера
|
||||
*/
|
||||
abstract public function prepareDataForMail(): BaseMailerObj;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Mail;
|
||||
|
||||
use Modules\Taxi\App\DTO\TaxiOrderDTO;
|
||||
use App\Mail\BaseMailerObj;
|
||||
|
||||
/**
|
||||
* Класс формирования объекта с данными для передачи в джобу отправки письма. Наследует базовый класс отправки письма по такси, где объвляется обязательный метод
|
||||
*/
|
||||
class NewOrderMail extends BaseTaxiMail
|
||||
{
|
||||
public function __construct(
|
||||
public TaxiOrderDTO $orderData,
|
||||
public ?int $orderId)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод подготавливает данные письма для передачи в джобу
|
||||
*
|
||||
* @return BaseMailerObj
|
||||
*/
|
||||
public function prepareDataForMail(): BaseMailerObj
|
||||
{
|
||||
return new BaseMailerObj(
|
||||
[$this->orderData->emp_login],
|
||||
"Создана заявка на такси",
|
||||
"Для вас создана заявка на такси № {$this->orderId}:
|
||||
<ul>
|
||||
<li><b>Дата:</b> {$this->orderData->taxi_date}</li>
|
||||
<li><b>Время:</b> {$this->orderData->taxi_time}</li>
|
||||
<li><b>Откуда:</b> {$this->orderData->taxi_address_from}</li>
|
||||
<li><b>Куда:</b> {$this->orderData->taxi_address_to}</li>
|
||||
</ul>",
|
||||
config('taxi.name_ru'),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Taxi\Database\factories\OfficeAddressFactory;
|
||||
|
||||
class OfficeAddress extends Model
|
||||
{
|
||||
protected $table = 'office_address';
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Taxi\Database\factories\TaxiMainFactory;
|
||||
//use Spatie\Activitylog\Traits\LogsActivity;
|
||||
// use Spatie\Activitylog\LogOptions;
|
||||
use App\Traits\LogsActivity_custom;
|
||||
use Modules\Taxi\App\DTO\TaxiOrderDTO;
|
||||
use App\Enums\LogBusinessEvents;
|
||||
|
||||
class TaxiMain extends Model
|
||||
{
|
||||
//use LogsActivity;
|
||||
use LogsActivity_custom;
|
||||
|
||||
protected $table = 'taxi_main';
|
||||
protected $guarded = [];
|
||||
|
||||
// protected $activityCustomProperties = [
|
||||
// 'emp_login' => 'dgavrilov',
|
||||
// ];
|
||||
|
||||
// public function getActivitylogOptions(): LogOptions
|
||||
// {
|
||||
// return LogOptions::defaults()
|
||||
// ->logAll()
|
||||
// ->logOnlyDirty()
|
||||
// ->useLogName('Taxi')
|
||||
// ->logExcept(['created_at', 'updated_at']);
|
||||
|
||||
// }
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
//В трейте LogsActivity_custom это свойство отвечает за название приложения, события в котором логируются. Оно записывается в поле activity_log.log_name
|
||||
$this->logActivity_custom__name = 'Taxi';
|
||||
$this->addCustomLogProperties(['custom__test' => 'test']);
|
||||
}
|
||||
|
||||
//ГАВРИЛОВ. сделай метод не статическим
|
||||
public static function getFieldsTitle()
|
||||
{
|
||||
return [
|
||||
'id' => 'Номер запроса',
|
||||
'emp_login' => 'Логин сотрудника',
|
||||
'emp_phone' => 'Телефон сотрудника',
|
||||
'taxi_date' => 'Дата заказа',
|
||||
'taxi_time' => 'Время заказа',
|
||||
'taxi_address_from' => 'Адрес откуда',
|
||||
'taxi_address_to' => 'Адрес куда',
|
||||
'cancel_rqst' => 'Запрос отменен',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public function createOrder(TaxiOrderDTO $orderData): string
|
||||
{
|
||||
//ГАВРИЛОВ. проверь будет ли возвращаться ошибка без try catch
|
||||
// try {
|
||||
|
||||
$this->logBusinessEvent(LogBusinessEvents::Create);
|
||||
$newOrder = $this->create(
|
||||
[
|
||||
'emp_login' => $orderData->emp_login,
|
||||
'taxi_date' => $orderData->taxi_date,
|
||||
'emp_phone' => $orderData->emp_phone,
|
||||
'taxi_time' => $orderData->taxi_time,
|
||||
'taxi_address_from' => $orderData->taxi_address_from,
|
||||
'taxi_address_to' => $orderData->taxi_address_to
|
||||
]
|
||||
);
|
||||
return $newOrder->id;
|
||||
// } catch (\Exception $e) {
|
||||
// return $e->getMessage();
|
||||
// }
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return string Метод нужен для переопределения параметра трейта. Простое переопределение вызывает конфликт
|
||||
// */
|
||||
//protected $logActivity_custom__name = 'Taxi';
|
||||
// public function getLogName(): string
|
||||
// {
|
||||
// return 'Taxi';
|
||||
// }
|
||||
|
||||
//protected $logActivity_custom__name;
|
||||
|
||||
// public function getActivitylogOptions(): LogOptions
|
||||
// {
|
||||
// //Через метод default() получаем параметры класса логирования по умолчанию. Ниже можем их переопределять в зависимости от специфики работы с моделью
|
||||
// $logOptions = LogOptions::defaults()
|
||||
// ->logOnly(['*']); //Устанавиваем список логируемых данных (полей модели), либо, как в этом случае, логируем все поля
|
||||
// //->logExcept(['created_at', 'updated_at']) //Не логируем поля изменения и создания записи в ЛЮБОМ случае
|
||||
// //->logOnlyDirty(); //Логируем только те поля, которые были изменены
|
||||
// $logOptions->logName = 'Taxi'; //Устанавливаем значение для имени приложения
|
||||
|
||||
// return $logOptions;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TaxiTimePeriod extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The module namespace to assume when generating URLs to actions.
|
||||
*/
|
||||
protected string $moduleNamespace = 'Modules\Taxi\App\Http\Controllers';
|
||||
protected $middleware_checkTimeRqstAvailable = [Modules\Taxi\Http\Middleware\CheckTimeRqstAvailability::class];
|
||||
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->moduleNamespace)
|
||||
->group(module_path('Taxi', '/routes/web.php'));
|
||||
|
||||
Route::prefix('taxi')
|
||||
->middleware('web')
|
||||
->group(base_path('Modules/Taxi/routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->moduleNamespace)
|
||||
->group(module_path('Taxi', '/routes/api.php'));
|
||||
|
||||
Route::prefix('taxi')
|
||||
->middleware('api')
|
||||
->group(base_path('Modules/Taxi/routes/api.php'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Taxi\App\Services\TaxiMailerService;
|
||||
|
||||
//Регистрация сервиса отправки писем по работе с Такси
|
||||
class TaxiMailerProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind(TaxiMailerService::class, function ($app) {
|
||||
return new TaxiMailerService();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Taxi\App\Services\TaxiOrderService;
|
||||
|
||||
class TaxiOrderProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind(TaxiOrderService::class, function($app) {
|
||||
return new TaxiOrderService();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Taxi\App\Console\SendOrdersToTaxiCommand;
|
||||
|
||||
//Не вполне помню зачем этот провайдер, для какого сервиса. Судя по названию, для работы с расписанием операций с приложением. Например, отправка итогового письма с заявками на такси или чистка чего-то
|
||||
class TaxiScheduleProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
// Регистрируем команду в системе
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([
|
||||
SendOrdersToTaxiCommand::class, // ✅ Теперь Laravel знает о команде
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
//Подозреваю, что это какой-то core провайдер для модуля
|
||||
class TaxiServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'Taxi';
|
||||
|
||||
protected string $moduleNameLower = 'taxi';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerCommands();
|
||||
$this->registerCommandSchedules();
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands in the format of Command::class
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
// $this->commands([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register command Schedules.
|
||||
*/
|
||||
protected function registerCommandSchedules(): void
|
||||
{
|
||||
// $this->app->booted(function () {
|
||||
// $schedule = $this->app->make(Schedule::class);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*/
|
||||
public function registerTranslations(): void
|
||||
{
|
||||
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
|
||||
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*/
|
||||
public function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
|
||||
$sourcePath = module_path($this->moduleName, 'resources/views');
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
|
||||
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.config('modules.paths.generator.component-class.path'));
|
||||
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (config('view.paths') as $path) {
|
||||
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
|
||||
$paths[] = $path.'/modules/'.$this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Services;
|
||||
|
||||
use Modules\Taxi\App\Mail\BaseTaxiMail;
|
||||
use Modules\Taxi\App\Jobs\TaxiMailJob;
|
||||
|
||||
|
||||
/**
|
||||
* Сервис отправки письма. Отвечает за формирование всех писем приложения Такси
|
||||
*/
|
||||
class TaxiMailerService
|
||||
{
|
||||
/**
|
||||
* Единый метод отправки всех писем по такси
|
||||
*
|
||||
* @param BaseTaxiMail $taxiMailClass
|
||||
* @return void
|
||||
*/
|
||||
public function sendMail(BaseTaxiMail $taxiMailClass)
|
||||
{
|
||||
#Гаврилов
|
||||
//delay наверное не нужен?
|
||||
//Вызов джобы для отправки письма
|
||||
TaxiMailJob::dispatch($taxiMailClass->prepareDataForMail())->onQueue('emails')->delay(5);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\App\Services;
|
||||
|
||||
use Modules\Taxi\App\Models as TaxiModels;
|
||||
use Modules\Taxi\App\DTO\TaxiOrderDTO;
|
||||
|
||||
/**
|
||||
* Сервис работы с заказами такси
|
||||
*/
|
||||
class TaxiOrderService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод создания заказа на такси
|
||||
*
|
||||
* @param TaxiOrderDTO $orderData объект с данными по заказу
|
||||
* @return int идентификатор созданного заказа
|
||||
*/
|
||||
public function createOrder(TaxiOrderDTO $orderData): string
|
||||
{
|
||||
//ГАВРИЛОВ. проверь будет ли возвращаться ошибка без try catch
|
||||
// try {
|
||||
$newOrder = TaxiModels\TaxiMain::create(
|
||||
[
|
||||
'emp_login' => $orderData->emp_login,
|
||||
'taxi_date' => $orderData->taxi_date,
|
||||
'emp_phone' => $orderData->emp_phone,
|
||||
'taxi_time' => $orderData->taxi_time,
|
||||
'taxi_address_from' => $orderData->taxi_address_from,
|
||||
'taxi_address_to' => $orderData->taxi_address_to
|
||||
]
|
||||
);
|
||||
return $newOrder->id;
|
||||
// } catch (\Exception $e) {
|
||||
// return $e->getMessage();
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Taxi\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class TaxiDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "nwidart/taxi",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Taxi\\": "",
|
||||
"Modules\\Taxi\\App\\": "app/",
|
||||
"Modules\\Taxi\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\Taxi\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\Taxi\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
#Гаврилов
|
||||
//РЕШИЛ, ЧТО ТАКОЙ КОНФИГ - МОЖЕТ БЫТЬ ОБЯЗАТЕЛЬНОЙ ЧАСТЬЮ КАЖДОГО МОДУЛЯ
|
||||
|
||||
return [
|
||||
'name' => 'Taxi',
|
||||
#Гаврилов
|
||||
//КАК ЗАСТАВИТЬ ПРИ СОЗДАНИИ МОДУЛЯ ЭТОТ ПАРАМЕТР ПРОПИСЫВАТЬ АВТОМАТИЧЕСКИ?
|
||||
'name_ru' => 'Реестр заказа такси', //Добавляем вручную в каждый конфиг
|
||||
];
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "Taxi",
|
||||
"alias": "taxi",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Taxi\\App\\Providers\\TaxiServiceProvider",
|
||||
"Modules\\Taxi\\App\\Providers\\TaxiOrderProvider",
|
||||
"Modules\\Taxi\\App\\Providers\\TaxiMailerProvider",
|
||||
"Modules\\Taxi\\App\\Providers\\TaxiScheduleProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^1.1.2",
|
||||
"laravel-vite-plugin": "^0.7.5",
|
||||
"sass": "^1.69.5",
|
||||
"postcss": "^8.3.7",
|
||||
"vite": "^4.0.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import MenuApp from './components/MenuApp.jsx'; // Создайте этот файл, если используете React
|
||||
|
||||
const container = document.getElementById('root');
|
||||
const root = createRoot(container);
|
||||
root.render(<MenuApp />);
|
||||
@@ -0,0 +1,44 @@
|
||||
table {
|
||||
|
||||
& td {
|
||||
padding: 5px;
|
||||
}
|
||||
& tr:nth-child(odd) {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
}
|
||||
|
||||
#taxi__order-create{
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#taxi__home__filter-form{
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.taxi-btn{
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.elem--title.el-title--big{
|
||||
padding: 7px;
|
||||
margin: 50px 0 25px 0;
|
||||
border-left: 5px solid #7864eb;
|
||||
font-size: 1.3rem;
|
||||
background: linear-gradient(90deg, rgb(237 234 255) 0%, rgb(255 255 255) 75%);
|
||||
border-top-left-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
display: inline-block;
|
||||
min-width: 400px;
|
||||
}
|
||||
|
||||
.form-field-block{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.taxi-orders__order-options{
|
||||
|
||||
& button {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.order-create__btn-block{
|
||||
margin: 20px 0;
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
import { tr } from "date-fns/locale";
|
||||
import React, { useEffect, useState, useMemo, useContext } from "react";
|
||||
import { TaxiOrder_type, TaxiOrder_initial, TaxiOrder_fieldName, TaxiOrder_tableData } from '../types/taxiOrderType';
|
||||
import { differenceInDays } from 'date-fns';
|
||||
import { getCsrfToken } from "../../../../../resources/js/services/getCsrfService";
|
||||
import { Button, TextInput, Select, Option } from '@SharePoint/rencredit_uikit';
|
||||
import { EntityHistoryProps } from "../../../../../resources/js/components/entityHistory/EntityHistory";
|
||||
import { HistoryProvider, HistoryContext } from "../../../../../resources/js/contexts/HistoryContext";
|
||||
import { PopupContext } from "../../../../../resources/js/contexts/PopupContext";
|
||||
import { PreloaderContext } from "../../../../../resources/js/contexts/PreloaderContext";
|
||||
import api from "../../../../../resources/js/api";
|
||||
|
||||
type EmpSupervisorsData = {
|
||||
emp_login: string,
|
||||
emp_supervisor: string
|
||||
}
|
||||
|
||||
export default function TaxiHome ()
|
||||
{
|
||||
//Массив полей для отображения в таблицах с заяками. Учитывается, в том числе, порядок
|
||||
const rqstTableFields = ['id', 'emp_login', 'emp_supervisor', 'emp_phone', 'taxi_date', 'taxi_time', 'taxi_address_from', 'taxi_address_to', 'cancel_rqst'];
|
||||
//Формируем объект с полями для таблицы
|
||||
const rqstTableHeaderFields: Record<keyof TaxiOrder_tableData, string> = Object.assign({}, ...rqstTableFields.map( field => {return {[field]: TaxiOrder_fieldName[field]}}));
|
||||
const rqstTableHeader:string[] = Object.keys(TaxiOrder_fieldName).map(rqstFieldName => TaxiOrder_fieldName[rqstFieldName]);
|
||||
const [ccEmp, setCcEmp] = useState<string[]>([]);
|
||||
//Стейт для руководителей сотрудников
|
||||
const [empSupervisors, setEmpSupervisors] = useState<EmpSupervisorsData[]>([]);
|
||||
const [allOrders, setAllOrders] = useState<TaxiOrder_type[]>([]);
|
||||
const [filterOrders, setFilterOrders] = useState<TaxiOrder_type[]>([]);
|
||||
const [startSearch, setStartSearch] = useState<boolean>(false);
|
||||
const [rqstNumber, setRqstNumber] = useState<string>('');
|
||||
const [rqstTime, setRqstTime] = useState<string>('');
|
||||
const [rqstLogin, setRqstLogin] = useState<string>('');
|
||||
const [orderTimePeriods, setOrderTimePeriods] = useState<[{time_period: string}]>([{time_period: ''}]);
|
||||
|
||||
const popupContext = useContext(PopupContext);
|
||||
const preloaderContext = useContext(PreloaderContext);
|
||||
|
||||
useEffect ( () => {
|
||||
api.get('/taxi/getTimePeriods',
|
||||
).then(timePeriods_json => setOrderTimePeriods(timePeriods_json.data));
|
||||
|
||||
// fetch('/public/api/taxi/getTimePeriods', {
|
||||
// method: 'GET',
|
||||
// credentials: 'include',
|
||||
// }).then(timePeriods_resp => timePeriods_resp.json().then( timePeriods_json => {
|
||||
// setOrderTimePeriods(timePeriods_json);
|
||||
// }));
|
||||
|
||||
setTimeout(() => {
|
||||
popupContext.addPopupArrTest([
|
||||
{message: 'для информации', timeOut: true, type: 'attention'}
|
||||
])
|
||||
popupContext.addPopupArrTest([
|
||||
{message: 'ошибка', timeOut: true, type: 'error'}
|
||||
])
|
||||
}, 1000);
|
||||
console.log(Object.keys(TaxiOrder_fieldName))
|
||||
}, [])
|
||||
|
||||
//ГАВРИЛОВ
|
||||
//ЕСЛИ ОБЪЕКТ СО ЗНАЧЕНИЯМИ ДЛЯ ПОИСКА ПУСТОЙ - НЕ ВЫПОЛНЯЕМ ПОИСК, ВОЗВРАЩАЕМ ОПОВЕЩЕНИЕ О ПУСТЫХ УСЛОВИЯХ
|
||||
const getFilterOrders = () => {
|
||||
console.log(rqstTime)
|
||||
console.log(rqstNumber)
|
||||
console.log(rqstLogin)
|
||||
setStartSearch(true);
|
||||
// ГАВРИЛОВ. проверь
|
||||
api.post('/taxi/getFilterOrders', {
|
||||
id: rqstNumber,
|
||||
taxi_time: rqstTime,
|
||||
emp_login: rqstLogin
|
||||
}).then(filterOrdersJson => {
|
||||
setFilterOrders(filterOrdersJson.data);
|
||||
})
|
||||
// fetch('/public/api/taxi/getFilterOrders', {
|
||||
// credentials: 'include',
|
||||
// method: 'POST',
|
||||
// body: JSON.stringify({
|
||||
// id: rqstNumber,
|
||||
// taxi_time: rqstTime,
|
||||
// emp_login: rqstLogin
|
||||
// }),
|
||||
// headers: {
|
||||
// 'content-type': 'application/json'
|
||||
// }
|
||||
// }).then(filterOrdersRqst => filterOrdersRqst.json())
|
||||
// .then(filterOrdersJson => {
|
||||
// setFilterOrders(filterOrdersJson);
|
||||
// })
|
||||
}
|
||||
|
||||
const timePeriodOptions: Option<string>[] = useMemo(() => {
|
||||
return orderTimePeriods.map((time: {time_period: string}) => {
|
||||
return {
|
||||
caption: time.time_period,
|
||||
value: time.time_period,
|
||||
id: time.time_period
|
||||
}
|
||||
})
|
||||
}, [orderTimePeriods])
|
||||
|
||||
const empLoginOptions: Option<string>[] = useMemo(() => {
|
||||
return ccEmp.map((empLogin: string) => {
|
||||
return {
|
||||
caption: empLogin,
|
||||
value: empLogin,
|
||||
id: empLogin
|
||||
}
|
||||
})
|
||||
}, [ccEmp])
|
||||
|
||||
useEffect ( () => {
|
||||
Promise.all(
|
||||
[
|
||||
// fetch('/public/api/taxi/getEmpInfo', {
|
||||
// credentials: 'include',
|
||||
// method: 'GET',
|
||||
// }).then( empInfo_resp => empInfo_resp.json() ),
|
||||
api.get('taxi/getEmpInfo'),
|
||||
api.get('taxi/getActiveOrders'),
|
||||
// fetch('/public/api/taxi/getActiveOrders', {
|
||||
// credentials: 'include',
|
||||
// method: 'GET',
|
||||
// }).then( allOrders_resp => allOrders_resp.json() )
|
||||
]
|
||||
).then(
|
||||
([
|
||||
{data: empInfo_json},
|
||||
{data: allOrders_json}
|
||||
]) => {
|
||||
setCcEmp(empInfo_json.map( (empInfoEl: {emp_login: String}) => empInfoEl.emp_login ));
|
||||
setAllOrders(allOrders_json);
|
||||
setEmpSupervisors(empInfo_json.map( (empInfoEl: {emp_login: String, emp_group: String}) => ({emp_login: empInfoEl.emp_login, emp_supervisor: empInfoEl.emp_group}) ));
|
||||
}
|
||||
)
|
||||
|
||||
}, [])
|
||||
|
||||
const isReady = ccEmp.length > 0 && orderTimePeriods.length > 0;
|
||||
|
||||
useEffect ( () => {
|
||||
console.log(!isReady)
|
||||
preloaderContext.setPreloaderVisible(!isReady)
|
||||
// setPreloaderProp(!isReady);
|
||||
// console.log(empSupervisors)
|
||||
}, [isReady])
|
||||
|
||||
if (!ccEmp.length || !orderTimePeriods.length) {
|
||||
//setIsReady(true);
|
||||
return;
|
||||
} else {
|
||||
//setIsReady(false);
|
||||
// console.log(allOrders);
|
||||
console.log(ccEmp);
|
||||
console.log(orderTimePeriods);
|
||||
}
|
||||
|
||||
// ГАВРИЛОВ. ОФОРМИ РЕЗУЛЬТАТЫ ПОИСКА. ПОСЛЕ ПОИСКА ПЛАВНО ОПУСКАЙ ДО ТАБЛИЦЫ РЕЗУЛЬТАТЫ ПОИСКА, ТАКЖЕ ВЫВЕДИ ЗОТЯ БЫ ТЕКСТ "РЕЗУЛЬТАТЫ ПОИСКА, СЕЙЧАС ЭТО ПРОСТО ТАБЛИЦА"
|
||||
|
||||
//Гаврилов
|
||||
//Реализовать подтягивание информации
|
||||
//Реализовать переключение между БД (new and old Magic)
|
||||
|
||||
//console.log(sanctumToken())
|
||||
|
||||
let newDate = new Date('2024-06-05');
|
||||
newDate.setHours(0, 0, 0);
|
||||
|
||||
// function callHistory(entityId) {
|
||||
// console.log(entityId)
|
||||
|
||||
// return fakeObjArr;
|
||||
// }
|
||||
|
||||
|
||||
// let resultObj = {
|
||||
// entityId: 1,
|
||||
// entityProps: fakeObjArr
|
||||
// }
|
||||
|
||||
return (
|
||||
<div id='taxi-container'>
|
||||
<Button
|
||||
type = 'button'
|
||||
text = 'Новая заявка'
|
||||
onClick = {
|
||||
() => document.location.href = 'createRqst'
|
||||
}
|
||||
className = "taxi-btn"
|
||||
/>
|
||||
<div className = "elem--title el-title--big">Активные заявки</div>
|
||||
<div className='container__table-block' id='taxi__rqst--active'>
|
||||
<HistoryProvider>
|
||||
<RqstTable
|
||||
allOrders={allOrders}
|
||||
rqstTableHeader={rqstTableHeaderFields}
|
||||
empSupervisors={empSupervisors}
|
||||
/>
|
||||
</HistoryProvider>
|
||||
</div>
|
||||
<div id="taxi__home__filter-form">
|
||||
<div className = "elem--title el-title--big">Поиск заявки</div>
|
||||
<form>
|
||||
<input
|
||||
type="hidden"
|
||||
name="_token"
|
||||
value={getCsrfToken()}
|
||||
/>
|
||||
<div>
|
||||
<TextInput
|
||||
labelText = 'Номер заявки'
|
||||
value = {rqstNumber}
|
||||
onChange = {(e: string) => setRqstNumber(e)}
|
||||
/>
|
||||
{/* <label htmlFor="">Номер заявки</label>
|
||||
<input type="number" onChange={ e => {
|
||||
setRqstNumber(e.target.value)
|
||||
}}></input> */}
|
||||
</div>
|
||||
{/* <div>
|
||||
<label htmlFor="">Дата с</label>
|
||||
<input type="date" />
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="">Дата по</label>
|
||||
<input type="date" />
|
||||
</div> */}
|
||||
<div>
|
||||
<Select
|
||||
labelText = "Время"
|
||||
options = {timePeriodOptions}
|
||||
size = '1'
|
||||
onChange = { (e: string) => {
|
||||
setRqstTime(e)
|
||||
}}
|
||||
/>
|
||||
{/* <label htmlFor="">Время</label>
|
||||
<select name="taxi_time" id="" onChange={ e => {
|
||||
setRqstTime(e.target.value)
|
||||
}}>
|
||||
<option key='0' value=''></option>
|
||||
{
|
||||
orderTimePeriods.map( (timePeriodEl, timePeriodIndex ) =>
|
||||
<option key={timePeriodIndex++} value={timePeriodEl.time_period}>{timePeriodEl.time_period}</option>
|
||||
)
|
||||
}
|
||||
</select> */}
|
||||
</div>
|
||||
<div>
|
||||
<Select
|
||||
labelText = "Сотрудник"
|
||||
options = {empLoginOptions}
|
||||
size = '1'
|
||||
onChange = { (e, selectedOption: {value: string}) => {
|
||||
setRqstLogin(selectedOption.value)
|
||||
}}
|
||||
/>
|
||||
{/* <label htmlFor="">Логин</label>
|
||||
<select onChange={ e => setRqstLogin(e.target.value) }>
|
||||
<option key="0" value=""></option>
|
||||
{
|
||||
ccEmp.map( (empDataEl: string, empDataIndex: number) =>
|
||||
<option key={empDataIndex++} value={empDataEl}>{empDataEl}</option>
|
||||
)
|
||||
}
|
||||
</select> */}
|
||||
</div>
|
||||
<Button
|
||||
className = "taxi-btn"
|
||||
type = 'button'
|
||||
text = 'Искать'
|
||||
onClick = { getFilterOrders }
|
||||
size = 's'
|
||||
ui = 'secondary'
|
||||
/>
|
||||
{/* <button type="button" onClick={getFilterOrders}>Искать</button> */}
|
||||
</form>
|
||||
</div>
|
||||
<div id = "container__filter-rqst-table">
|
||||
{
|
||||
startSearch ?
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{
|
||||
rqstTableHeader.map( (headEl, headElIndex) =>
|
||||
<th key={headElIndex} className = "table-header">
|
||||
{headEl}
|
||||
</th>)
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
filterOrders.length ?
|
||||
filterOrders.map( (rqstData: TaxiOrder_type, rqstIndex: number) =>
|
||||
<tr key={rqstIndex}>
|
||||
{
|
||||
Object.keys(TaxiOrder_initial).map(initField =>
|
||||
<td>
|
||||
{initField == 'cancel_rqst' ? (rqstData[initField] ? 'Нет' : 'Да') : rqstData[initField]}
|
||||
</td>)
|
||||
}
|
||||
</tr>)
|
||||
: <tr>
|
||||
<td>Запросов не найдено</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
function RqstTable(props: {allOrders: TaxiOrder_type[], rqstTableHeader: Record<keyof TaxiOrder_tableData, string>, empSupervisors: EmpSupervisorsData[]}){
|
||||
const historyContext = useContext(HistoryContext);
|
||||
if (!historyContext) {
|
||||
return null;
|
||||
}
|
||||
let newDate = new Date('2024-06-05');
|
||||
newDate.setHours(0, 0, 0);
|
||||
return (
|
||||
props.allOrders.length ?
|
||||
<table className="taxi-orders">
|
||||
<thead>
|
||||
<tr>
|
||||
{
|
||||
Object.entries(props.rqstTableHeader).map((el, index) =>
|
||||
<th key={index} className="table-header">{el[1]}</th>
|
||||
)
|
||||
}
|
||||
<th className = "table-header">Управление</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
props.allOrders.map( (rqstData: TaxiOrder_type, rqstIndex: number) =>
|
||||
<tr key = {rqstIndex}>
|
||||
{
|
||||
Object.entries(props.rqstTableHeader).map( el => {
|
||||
return (
|
||||
// Если поле - руководитель сотрудника - вычисляем значение, ориентируясь на список props.empSupervisors
|
||||
el[0] === 'emp_supervisor' ?
|
||||
<td key={el[0]}>{ props.empSupervisors.find(empData => empData.emp_login == rqstData.emp_login)?.emp_supervisor }</td>
|
||||
: <td key={el[0]}>{ rqstData[el[0]] }</td>
|
||||
)
|
||||
})
|
||||
}
|
||||
<td className="taxi-orders__order-options">
|
||||
{/* Можно взаимодействовать только с заявками на такси на сегодняшнюю, либо завтрашнюю дату */}
|
||||
{differenceInDays(new Date(rqstData.taxi_date), new Date()) >= 0 && !rqstData.cancel_rqst ?
|
||||
<>
|
||||
<Button
|
||||
type = 'button'
|
||||
onClick = { () => { document.location.href = `editOrder/${rqstData.id}` } }
|
||||
text = {'Редактировать'}
|
||||
ui = 'secondaryPurple'
|
||||
/>
|
||||
<Button
|
||||
type = 'button'
|
||||
onClick = { () => { document.location.href = `cancelRqst/${rqstData.id}` } }
|
||||
text = {'Отменить'}
|
||||
ui = 'secondaryPurple'
|
||||
/>
|
||||
<Button
|
||||
type = 'button'
|
||||
onClick = { () => { historyContext.getHistoryFromMagic('taxi', rqstData.id, TaxiOrder_fieldName) } }
|
||||
text = {'История'}
|
||||
ui = 'secondaryPurple'
|
||||
/>
|
||||
</>
|
||||
: ""
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
: <div>Нет активных заявок</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,635 @@
|
||||
import React, { useEffect, useContext, useState, useMemo } from "react";
|
||||
import { TaxiOrder_type, TaxiOrder_initial } from '../types/taxiOrderType';
|
||||
import { addDays, format } from 'date-fns';
|
||||
import { getCsrfToken } from "../../../../../resources/js/services/getCsrfService";
|
||||
import { Button, TextInput, Select, Option } from '@SharePoint/rencredit_uikit';
|
||||
import FormValidErr, { FormValidErrObject } from "../../../../../resources/js/components/formValidErr/FormValidErr";
|
||||
import { PopupContext } from "../../../../../resources/js/contexts/PopupContext";
|
||||
import { EntityHistoryProps } from "../../../../../resources/js/components/entityHistory/EntityHistory";
|
||||
import { PreloaderContext } from "../../../../../resources/js/contexts/PreloaderContext";
|
||||
|
||||
//Гаврилов типы для пропсов?
|
||||
// export default function TaxiOrder( {rqstId, setPreloaderProp}: {rqstId: number | undefined, setPreloaderProp: CallableFunction} )
|
||||
export default function TaxiOrder( {rqstId}: {rqstId: number | undefined} )
|
||||
{
|
||||
let newDate = new Date('2024-06-05');
|
||||
newDate.setHours(0, 0, 0);
|
||||
let fakeObjArr: EntityHistoryProps[] = [
|
||||
{
|
||||
changeAction: 'insert',
|
||||
changeAuthor: 'login',
|
||||
changeDate: newDate,
|
||||
changeDetails: [
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле2',
|
||||
propValue: 'значение2'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changeAction: 'insert',
|
||||
changeAuthor: 'login',
|
||||
changeDate: new Date('2024-06-05'),
|
||||
changeDetails: [
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле2',
|
||||
propValue: 'значение2'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changeAction: 'insert',
|
||||
changeAuthor: 'login',
|
||||
changeDate: new Date('2024-06-05'),
|
||||
changeDetails: [
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле',
|
||||
propValue: 'значение'
|
||||
},
|
||||
{
|
||||
propName: 'поле2',
|
||||
propValue: 'значение2'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changeAction: 'update',
|
||||
changeAuthor: 'login2',
|
||||
changeDate: new Date('2025-06-05'),
|
||||
changeDetails: [
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле5',
|
||||
propValue: 'значение6'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
changeAction: 'update',
|
||||
changeAuthor: 'login2',
|
||||
changeDate: new Date('2025-06-05'),
|
||||
changeDetails: [
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле3',
|
||||
propValue: 'значение4'
|
||||
},
|
||||
{
|
||||
propName: 'поле5',
|
||||
propValue: 'значение6'
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const preloaderContext = useContext(PreloaderContext);
|
||||
|
||||
//ГАВРИЛОВ ПОСТОЯННЫЙ ПЕРЕРЕНДЕРИНГ СПРОСИТЬ У САШИ. ЭЛЕМЕНТ НЕ МИГАЕТ В КОНСОЛИ, НО ПИШЕТ ПОСТОЯННО ПЕРЕРЕНДЕР
|
||||
console.log('🔁 TaxiForm перерендерился!');
|
||||
interface UserData {
|
||||
emp_id: number,
|
||||
emp_address: string,
|
||||
emp_lastname: string,
|
||||
emp_name: string,
|
||||
emp_surname: string,
|
||||
emp_login: string | null
|
||||
emp_phone: string,
|
||||
//Все остальные поля объекта могут быть пустыми
|
||||
[key: string]: unknown,
|
||||
full_name: string,
|
||||
};
|
||||
const UserData_initial: UserData = {
|
||||
emp_id: 0,
|
||||
emp_address: '',
|
||||
emp_lastname: '',
|
||||
emp_name: '',
|
||||
emp_surname: '',
|
||||
emp_login: '',
|
||||
emp_phone: '',
|
||||
full_name: '',
|
||||
// _token: getCsrfToken()
|
||||
};
|
||||
//Проверка загрузки необходимых для начала работ данных. После успешного получения всех данных происходит рендеринг
|
||||
const [checkLoad, setCheckLoad] = useState(
|
||||
{
|
||||
ccEmp: false,
|
||||
orderData: false,
|
||||
checkEditOrderUserData: false,
|
||||
getTimePeriods: false,
|
||||
checkOfficeAddress: false,
|
||||
}
|
||||
);
|
||||
const todayDate = new Date();
|
||||
//Данные по всем пользователям
|
||||
const [ccEmp, setCcEmp] = useState<UserData[]>( [UserData_initial] );
|
||||
//Данные по редактируемому запросу (если вызвано редактирование)
|
||||
const [orderData, setOrderData] = useState<TaxiOrder_type>(TaxiOrder_initial);
|
||||
//Данные по пользователю, чей запрос редактируется (если вызвано редактирование запроса)
|
||||
const [editOrderUserData, setEditOrderUserData] = useState<UserData>(UserData_initial);
|
||||
//Данные по временным промежуткам
|
||||
const [orderTimePeriods, setOrderTimePeriods] = useState< {time_period: string, is_morning_time: number}[] >(
|
||||
[ {time_period: '', is_morning_time: 0} ]
|
||||
);
|
||||
//Массив доступных для заказа такси дат для их дальнейшего преобразования в теги option селекта
|
||||
const [dateOrderArr, setDateOrderArr] = useState<string[]>(
|
||||
[
|
||||
format(todayDate, "yyyy-MM-dd"),
|
||||
format(addDays(todayDate, 1), "yyyy-MM-dd")
|
||||
]
|
||||
);
|
||||
const popupContext = useContext(PopupContext);
|
||||
useEffect ( () => {
|
||||
setFormCreateVisible(true);
|
||||
setFormCreateValidObj([{fieldName: 'testField', fieldErrors: ['errOne']}]);
|
||||
console.log(popupContext)
|
||||
// console.log()
|
||||
// setTimeout(() => {
|
||||
// popupContext.addPopupArrTest([
|
||||
// {message: 'для информации', timeOut: true, type: 'attention'}
|
||||
// ])
|
||||
// }, 1000);
|
||||
// setTimeout(() => {
|
||||
// setPopupArrProp([
|
||||
// {message: 'для информации', timeOut: true, type: 'attention'},
|
||||
// ])
|
||||
// }, 1000);
|
||||
// setTimeout(() => {
|
||||
// setPopupArrProp([
|
||||
// {message: 'для информации', timeOut: false, type: 'info'},
|
||||
// ])
|
||||
// }, 2000);
|
||||
// setTimeout(() => {
|
||||
// setPopupArrProp([
|
||||
// {message: 'для информации', timeOut: false, type: 'info'},
|
||||
// ])
|
||||
// }, 3000);
|
||||
// setPopupArrProp([
|
||||
// {message: 'для информации', timeOut: false, type: 'info'},
|
||||
// {message: 'успешно', timeOut: true, type: 'success'},
|
||||
// {message: 'ошибка', timeOut: true, type: 'error'},
|
||||
// {message: 'обратить внимание', timeOut: true, type: 'attention'}
|
||||
// ])
|
||||
}, [])
|
||||
|
||||
const [formCreateVisible, setFormCreateVisible] = useState<boolean>(false);
|
||||
const [formCreateValidErrObj, setFormCreateValidObj] = useState<FormValidErrObject[]>([{fieldName: null, fieldErrors: []}])
|
||||
|
||||
//ГАВРИЛОВ ДОБАВИТЬ ВСПЛЫВАЮЩЕЕ ОКНО ЕСЛИ ПРОИСХОДИТ НЕСООТВЕТСТВИЕ ВРЕМЕНИ И ДАТЫ ЗАКАЗА ТАКСИ? А НЕ ПРОСТО УДАЛЯТЬ ЗНАЧЕНИЕ ИЗ СОСЕДНЕГО ПОЛЯ?
|
||||
|
||||
//Адреса офисов
|
||||
const [officeAddressInfo, setOfficeAddressInfo] = useState< {place: string, address: string}[] >(
|
||||
[ {place: '', address: ''} ]
|
||||
);
|
||||
//Адрес офиса, где работает сотрудник. Определяется на этапе выбора логина
|
||||
const [empOfficeAddress, setEmpOfficeAddress] = useState<string | null>(null);
|
||||
//const [orderTime, setOrderTime] = useState<string|null>(null);
|
||||
//const [orderDate, setOrderDate] = useState<string|null>(null);
|
||||
// const [orderAddressFrom, setOrderAddressFrom] = useState<string|null>(null);
|
||||
// const [orderAddressTo, setOrderAddressTo] = useState<string|null>(null);
|
||||
|
||||
function gotoHome()
|
||||
{
|
||||
document.location.href = '/public/taxi/home';
|
||||
}
|
||||
|
||||
//Гаврилов. Не передаешь CSRF токен
|
||||
//Отправка заказа на такси
|
||||
function sendTaxiOrder ()
|
||||
{
|
||||
console.log(orderData)
|
||||
console.log(editOrderUserData)
|
||||
//return
|
||||
// setPreloaderProp(true, 'создаем заявку')
|
||||
preloaderContext.setPreloaderVisible(true);
|
||||
preloaderContext.setPreloaderText('создаем заявку');
|
||||
let popupType;
|
||||
fetch('/public/api/taxi/' + (rqstId ? `editOrder/${rqstId}` : 'createRqst'), {
|
||||
credentials: 'include',
|
||||
method: (rqstId ? "PATCH" : "POST"),
|
||||
body: JSON.stringify(orderData),
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
}).then(result => {
|
||||
preloaderContext.setPreloaderVisible(false);
|
||||
// setPreloaderProp(false)
|
||||
result.json().then(jsonResult => {
|
||||
console.log(jsonResult)
|
||||
if (!result.ok) {
|
||||
//ГАВРИЛОВ здесь обработка ошибок валидации формы
|
||||
if (result.status == 422) {
|
||||
// setPopupArrProp(
|
||||
// [
|
||||
// //ГАВРИЛОВ обработка ошибки
|
||||
// {message: 'Произошла ошибка! Заявка не создана', type: 'error'},
|
||||
// ]
|
||||
// )
|
||||
} else {
|
||||
// setPopupArrProp(
|
||||
// [
|
||||
// //ГАВРИЛОВ обработка ошибки
|
||||
// {message: jsonResult.result_msg, type: 'error'},
|
||||
// ]
|
||||
// )
|
||||
}
|
||||
popupType = 'error'
|
||||
} else {
|
||||
popupType = 'success'
|
||||
}
|
||||
popupContext.addPopupArrTest(
|
||||
[
|
||||
{message: jsonResult.message, type: popupType},
|
||||
]
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
//Функция, собирающая нужный массив для формирования из него списка option для select
|
||||
function transformToOptionsFunc <T,>(
|
||||
dataArr: T[],
|
||||
dataKey?: keyof T
|
||||
): Option<string>[] {
|
||||
let optionArr = dataArr.map(item => {
|
||||
//Без проверки ниже, Typescript ругается на условный атрибут dataKey, который может отсутствовать, но при этом укаан как относящийся к Дженерику
|
||||
const value = dataKey !== undefined
|
||||
? item[dataKey]
|
||||
: item;
|
||||
|
||||
return {
|
||||
caption: String(value),
|
||||
value: String(value),
|
||||
id: String(value)
|
||||
};
|
||||
});
|
||||
return optionArr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Метод проверки соответствует ли дата и время заказа логике. Наприме, если дата заказа сегодняшняя - нельзя выбрать утренний промежуток времени
|
||||
* @param orderTime время заказа такси
|
||||
* @param orderDate дата заказа такси
|
||||
* @returns результат проверки соответствия даты и времени заказа
|
||||
*/
|
||||
function checkTimeAndDate (orderTime: string|null, orderDate: string|null): boolean
|
||||
{
|
||||
// console.log(orderTime)
|
||||
// console.log(!orderTime)
|
||||
// console.log(orderDate)
|
||||
// console.log(!orderDate)
|
||||
if (!orderTime || !orderDate) {
|
||||
//console.log(1)
|
||||
return true;
|
||||
}
|
||||
let isMorningTimeCheck = orderTimePeriods.filter( e => e.time_period == orderTime )[0].is_morning_time;
|
||||
// console.log(isMorningTimeCheck)
|
||||
//Если выбранная дата заказа больше текущей - заказ на завтра, можно выбирать любую дату
|
||||
if (!(new Date(orderDate) > todayDate)) {
|
||||
//console.log(2)
|
||||
return !isMorningTimeCheck;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// const ccEmpList: Option<string>[] = useMemo(() => {
|
||||
// return ccEmp.map(empData => {
|
||||
// return {
|
||||
// caption: empData.emp_login,
|
||||
// value: empData.emp_login,
|
||||
// id: empData.emp_login
|
||||
// }
|
||||
// })
|
||||
// }, [ccEmp]);
|
||||
|
||||
// console.log(ccEmpList)
|
||||
|
||||
|
||||
const ccEmpList = useMemo( () => {
|
||||
return transformToOptionsFunc(ccEmp, 'emp_login');
|
||||
}, [ccEmp]);
|
||||
|
||||
const orderDateList = useMemo( () => {
|
||||
return transformToOptionsFunc(dateOrderArr);
|
||||
}, [dateOrderArr]);
|
||||
|
||||
const orderTimeList = useMemo( () => {
|
||||
return transformToOptionsFunc(orderTimePeriods, 'time_period')
|
||||
}, [orderTimePeriods]);
|
||||
|
||||
//Загрузка данных для старта работ
|
||||
useEffect ( () => {
|
||||
//Получаем информацию по сотруднику при загрузке страницы
|
||||
fetch('/public/api/taxi/getEmpInfo', {
|
||||
credentials: 'include',
|
||||
method: 'GET',
|
||||
// headers: new Headers({
|
||||
// 'Authorization': `Bearer ${sanctumToken()}`
|
||||
// })
|
||||
}).then(empInfo_resp => empInfo_resp.json().then(empInfo_json => {
|
||||
console.log(empInfo_json)
|
||||
console.log(editOrderUserData)
|
||||
setCcEmp(empInfo_json);
|
||||
setCheckLoad(loadObj => ( {...loadObj, ccEmp: true} ));
|
||||
}));
|
||||
//Получаем доступные временные промежутки для заказа такси
|
||||
fetch('/public/api/taxi/getTimePeriods', {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
// headers: new Headers({
|
||||
// 'Authorization': `Bearer ${sanctumToken()}`
|
||||
// })
|
||||
}).then(timePeriods_resp => timePeriods_resp.json().then(timePeriods_json => {
|
||||
setOrderTimePeriods(timePeriods_json);
|
||||
setCheckLoad(loadObj => ( {...loadObj, getTimePeriods: true} ));
|
||||
}));
|
||||
//ГАВРИЛОВ. ВЕЗДЕ В FETCH ЗАПРОСАХ ПЕРЕХВАТЫВАЙ ОШИБКИ И ВЫВОДИ СООБЩЕНИЯ ОБ ОШИБКЕ. НАПРИМЕМР С 401. В ЭТОМ СЛУЧАЕ НУЖНО ПЕРЕБРАСЫВАТЬ ПОЛЬЗОВАТЕЛЯ НА СТРАНИЦУ АУТЕНТИФИКАЦИИ
|
||||
//Получае адреса всех офисов, куда могут заказываться такси?
|
||||
fetch('/public/api/taxi/getOfficeAddress', {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
}).then(officeAddress_resp => {officeAddress_resp.json().then(officeAddress_json => {
|
||||
setOfficeAddressInfo(officeAddress_json);
|
||||
setCheckLoad(loadObj => ( {...loadObj, checkOfficeAddress: true} ));
|
||||
})});
|
||||
//Если в пропсах передается rqstId, происходит редактирование заявки, а не создание новой - получаем данные по редактируемой заявке на такси
|
||||
if (rqstId) {
|
||||
fetch(`/public/api/taxi/getOrderById/${rqstId}`, {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
// headers: new Headers({
|
||||
// 'Authorization': `Bearer ${sanctumToken()}`
|
||||
// })
|
||||
}).then(orderData_resp => orderData_resp.json().then( orderData_json => {
|
||||
console.log(orderData_json)
|
||||
setOrderData(orderData_json);
|
||||
setCheckLoad(loadObj => ({...loadObj, orderData: true}));
|
||||
}));
|
||||
}
|
||||
}, [])
|
||||
|
||||
//гаврилов. Нужно ввести объект с данными по запросу и туда класть только нужные данные , а не все параметры пользователя. и тогда не нужно нигде проверять rqstId. Внизу в методе класть в этот объект все нужные параметры
|
||||
|
||||
useEffect ( () => {
|
||||
//Гаврилов. Причем тут проверка логина? Зачем она?
|
||||
if (rqstId && orderData.emp_login) {
|
||||
//Если передан id запроса на редактирование, устанавливаем значение с данными пользователя редактируемого запроса
|
||||
fetch(`/public/api/taxi/getEmpInfo/${orderData.emp_login}`).then(userData_resp => userData_resp.json().then(userData_json => {
|
||||
//гаврилов. Вот здесь нужно класть данные в orderData, а также заполнять адрес из и адрес куда
|
||||
setEditOrderUserData(userData_json[0]);
|
||||
//setOrderData(prevData => ({...prevData, userData_json[0]}));
|
||||
//setEmpAddress(editOrderUserData['emp_address']);
|
||||
setCheckLoad(loadObj => ( {...loadObj, checkEditOrderUserData: true} ));
|
||||
//ГАВРИЛОВ. вынеси в отедльную функцию определение адреса офиса?
|
||||
setEmpOfficeAddress(officeAddressInfo.filter(addressInfo => addressInfo.place == userData_json[0].emp_area)[0].address);
|
||||
}));
|
||||
}
|
||||
}, [orderData.emp_login])
|
||||
|
||||
//Итоговая проверка все ли необходимые данные для рендеринга получены
|
||||
const isReady = rqstId ?
|
||||
checkLoad.ccEmp && checkLoad.checkEditOrderUserData && checkLoad.orderData && checkLoad.checkOfficeAddress && checkLoad.getTimePeriods
|
||||
: checkLoad.ccEmp;
|
||||
|
||||
//Регулировка видимости прелоадера в зависимости от того все ли данные для рендеринга получены или нет
|
||||
useEffect ( () => {
|
||||
//isReady ? setPreloaderProp(false) : setPreloaderProp(true);
|
||||
isReady ? preloaderContext.setPreloaderVisible(false) : preloaderContext.setPreloaderVisible(true);
|
||||
}, [isReady])
|
||||
|
||||
if (!isReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
return (
|
||||
<div id = "taxi__order-create">
|
||||
{/* <EntityHistory
|
||||
entityId={1}
|
||||
entityProps= {fakeObjArr}
|
||||
/> */}
|
||||
<div className = "order-create__btn-block">
|
||||
<Button
|
||||
type = 'button'
|
||||
onClick = {gotoHome}
|
||||
text = 'Домой'
|
||||
ui = 'secondary'
|
||||
/>
|
||||
</div>
|
||||
<h2>{rqstId ? 'Редактирование' : 'Создание'} заявки на такси</h2>
|
||||
<div className="form-container form-container--medium-size form-containter--left-pos">
|
||||
{/* <FormValidErr
|
||||
visible = {formCreateVisible}
|
||||
validErrorsObj = {formCreateValidErrObj}
|
||||
/> */}
|
||||
<form>
|
||||
{/* ГАВРИЛОВ как защищаешься от csrf если комментируешь поле ниже? */}
|
||||
{/* <input
|
||||
type="hidden"
|
||||
name="_token"
|
||||
value={getCsrfToken()}
|
||||
/> */}
|
||||
<div className="form__field-block">
|
||||
<Select
|
||||
//ГАВРИЛОВ. ПЕРЕПИШИ НА ОПРЕДЕЛЕНИЕ НАЗВАНИЯ ПОЛЯ, СОГЛАСНО TaxiOrder_fieldName ИЗ TAXIORDERTYPE
|
||||
labelText = 'Дата заказа'
|
||||
options = {orderDateList}
|
||||
//Гаврилов. Может где-то сверху нужно класть в объект с данными формы данные из orderData (если она есть) .тогда не нужно проверять props.rqstId ?
|
||||
value = {orderData.taxi_date ? orderDateList.find(dateData => dateData.value === orderData.taxi_date) : null}
|
||||
size = 'm'
|
||||
onChange = {
|
||||
(_, sel:{caption:string, id:string, value:string} ) => {
|
||||
let selOrderDate: string|null = (sel ? sel.value : null);
|
||||
//setEditOrderUserData(prevData => ({...prevData, taxi_date: selOrderDate}));
|
||||
setOrderData(prevData => ( {...prevData, taxi_date: selOrderDate} ));
|
||||
//Если проверка соответствия времени и даты заказа не выполняется, сбрасываем время.
|
||||
// if (!checkTimeAndDate(orderData.taxi_time, selOrderDate)) {
|
||||
popupContext.addPopupArrTest( [{message: 'Несоответствие времени и даты', type: 'error'}] )
|
||||
// setOrderData(prevData => ( {...prevData, taxi_time: null} ));
|
||||
// }
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="form__field-block">
|
||||
<Select
|
||||
labelText = "Время заказа"
|
||||
options = {orderTimeList}
|
||||
value = {orderData.taxi_time ? orderTimeList.find(dateData => dateData.value === orderData.taxi_time) : null}
|
||||
size = 'm'
|
||||
onChange = {(_, sel:{caption:string, id:string, value:string}) => {
|
||||
let selOrderTime = (sel ? sel.value : null);
|
||||
setOrderData(prevData => ( {...prevData, taxi_time: selOrderTime} ));
|
||||
//Проверяем относится ли выбранный промежуток времени заказа к утру или нет. Если выбран утренний промежуток, дата откуда - адрес сотрудника, адрес куда - офис, если выбран вечерний промежуток - наоборот
|
||||
if (orderTimePeriods.filter( e => selOrderTime == e.time_period )[0].is_morning_time == 1) {
|
||||
console.log(1)
|
||||
setOrderData(prevData => ( {...prevData, taxi_address_from: editOrderUserData.emp_address, taxi_address_to: empOfficeAddress} ));
|
||||
} else {
|
||||
console.log(2)
|
||||
console.log(empOfficeAddress)
|
||||
setOrderData(prevData => ( {...prevData, taxi_address_from: empOfficeAddress, taxi_address_to: editOrderUserData.emp_address} ));
|
||||
}
|
||||
//Если проверка соответствия и времени заказа не выполняется, сбрасываем дату
|
||||
if (!checkTimeAndDate(selOrderTime, orderData.taxi_date)) {
|
||||
popupContext.addPopupArrTest(
|
||||
[{message: 'Несоответствие времени и даты', type: 'error'}]
|
||||
)
|
||||
setOrderData(prevData => ({...prevData, taxi_date: null}));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="form__field-block">
|
||||
<Select
|
||||
labelText = 'Логин сотрудника'
|
||||
options = {ccEmpList}
|
||||
value = {orderData.emp_login}
|
||||
size = 'm'
|
||||
//В компоненте Select значение "выбранного" option помещается во второй аргумент onChange
|
||||
onChange = { (_, sel:{caption:string, id:string, value:string}) => {
|
||||
if (sel) {
|
||||
let empData = ccEmp.filter(empData => {return empData.emp_login == sel.value})[0];
|
||||
//При создании нового запроса, на этом действии время и дата могут быть уже записаны в объект editOrderUserData, но при выборе нового логина, если передать в сеттер setEditOrderUserData только объект empData, он перезапишет значения времени и даты, поэтому конкатенируем объект, отдавая приоритет при замене дублирующих значений empData (правый объект перезапишет левый)
|
||||
setEditOrderUserData( {...editOrderUserData, ...empData} );
|
||||
setOrderData(prevData => ({...prevData, emp_login: sel.value, emp_phone: empData.emp_phone}));
|
||||
//Гаврилов. Если площадка РКЦ - выводить ошибку? Так как у этой площадки нет адреса офиса
|
||||
//ГАВРИЛОВ. ВЫНЕСИ ОПРЕДЕЛЕНИЕ АДРЕСА В ОТДЕЛЬНУЮ ФУНКЦИЮ?
|
||||
let officeAddress: string | null = empData.emp_area == 'РКЦ' ? null : officeAddressInfo.filter(addressInfo => addressInfo.place == empData.emp_area)[0].address;
|
||||
setEmpOfficeAddress(officeAddress);
|
||||
setOrderData(prevData => {
|
||||
let setAddressTo: string|null, setAddressFrom: string|null;
|
||||
//Если время выставлено в форме
|
||||
if (orderData.taxi_time) {
|
||||
//Проверяем относится ли выбранный промежуток времени заказа к утру или нет. Если выбран утренний промежуток, дата откуда - адрес сотрудника, адрес куда - офис, если выбран вечерний промежуток - наоборот
|
||||
if (orderTimePeriods.filter( e => orderData.taxi_time == e.time_period )[0].is_morning_time == 1) {
|
||||
setAddressTo = officeAddress;
|
||||
setAddressFrom = empData.emp_address;
|
||||
} else {
|
||||
setAddressTo = empData.emp_address;
|
||||
setAddressFrom = officeAddress;
|
||||
}
|
||||
//Если время заказа не выбрано, сбрасываем дату откуда и дату куда
|
||||
} else {
|
||||
setAddressTo = null;
|
||||
setAddressFrom = null;
|
||||
}
|
||||
return {...prevData, taxi_address_from: setAddressFrom, taxi_address_to: setAddressTo};
|
||||
});
|
||||
} else {
|
||||
setOrderData(prevData => ({...prevData, emp_login: null, emp_phone: null}));
|
||||
setEditOrderUserData(UserData_initial);
|
||||
setEmpOfficeAddress(null);
|
||||
setOrderData(prevData => ({...prevData, taxi_address_from: null, taxi_address_to: null}));
|
||||
}
|
||||
} }
|
||||
//При редактировании существующего запроса нельзя менять выбранный логин сотрудника для заказа
|
||||
disabled = {rqstId ? true : false}
|
||||
/>
|
||||
</div>
|
||||
<div className="form__field-block">
|
||||
<TextInput
|
||||
labelText = 'ФИО'
|
||||
value = {editOrderUserData.full_name}
|
||||
disabled = {true}
|
||||
/>
|
||||
</div>
|
||||
<div className="form__field-block">
|
||||
<TextInput
|
||||
labelText = 'Мобильный номер телефона'
|
||||
value = {orderData.emp_phone}
|
||||
onChange = {(e: string) => {
|
||||
setOrderData(prevData => ({...prevData, emp_phone: e}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="form__field-block">
|
||||
<TextInput
|
||||
labelText = 'Адрес (откуда)'
|
||||
value = {
|
||||
//Если в пропсы передается id запроса, проставляем значение из параметров имеющегося запроса. В противном случае определяем является ли выбранный временной промежуток утренним. Если да - прописываем, что едем из адреса сотрудника, в противном случае - из офиса
|
||||
//Гаврилов. Будет ли при редактировании уже созданного запроса, работать смена адресов при изменении времени запроса? Или всегда будет искаться props.rqstId и логика будет исходить из этого?
|
||||
orderData.taxi_address_from
|
||||
}
|
||||
onChange = { (e: string) => {
|
||||
setOrderData(prevData => ({...prevData, taxi_address_from: e}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className = "form__field-block">
|
||||
<TextInput
|
||||
labelText = 'Адрес (куда)'
|
||||
value = {orderData.taxi_address_to}
|
||||
onChange = {(e: string) => {
|
||||
setOrderData(prevData => ({...prevData, taxi_address_to: e}));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className = "order-create__btn-block">
|
||||
<Button
|
||||
type = 'button'
|
||||
onClick = {sendTaxiOrder}
|
||||
text = 'Отправить'
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { AppProvider } from '../../../../../resources/js/providers/AppProvider.tsx';
|
||||
import TaxiHome from '../components/TaxiHome.tsx';
|
||||
|
||||
const container:HTMLElement = document.getElementById('root')!;
|
||||
const root = createRoot(container);
|
||||
|
||||
root.render(
|
||||
<AppProvider>
|
||||
<TaxiHome/>
|
||||
</AppProvider>
|
||||
);
|
||||
@@ -0,0 +1,37 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import React from 'react';
|
||||
import '@SharePoint/rencredit_uikit/dist/static/fonts/mont/Mont.css';
|
||||
import { AppProvider } from '../../../../../resources/js/providers/AppProvider.tsx';
|
||||
import TaxiOrder from '../components/TaxiOrder.tsx';
|
||||
|
||||
const container:HTMLElement = document.getElementById('root')!;
|
||||
const root = createRoot(container);
|
||||
|
||||
//ГАВРИЛОВ
|
||||
//не забудь обернуть рендер editOrder так же в PopupProvider. И вообще это дубирование выглядит костыльно
|
||||
|
||||
//Гаврилов
|
||||
//Спроси у дипсика насколько корректно таким образом получать аргументы из URLA
|
||||
if (document.location.pathname.split('/').find(el => el === 'editOrder')) {
|
||||
let rqstIdUrl = parseInt(document.location.pathname.split('/').pop());
|
||||
root.render(
|
||||
<AppProvider>
|
||||
<TaxiOrder
|
||||
rqstId = {rqstIdUrl}
|
||||
/>
|
||||
</AppProvider>
|
||||
);
|
||||
} else {
|
||||
root.render(
|
||||
<AppProvider>
|
||||
{/* Не получится передавать контейнер попапов на этом этапе, так как компоненты приложения (формы Такси) должны иметь общего родителя с компонентом контейнеров попапов, иначе они не смогут знать через общий стейт какое состояние у набора попапов */}
|
||||
{/* ГАВРИЛОВ ругается на указание параметра rqstId в TaxiPage? */}
|
||||
{/* <TaxiOrderPage rqstId = {undefined}/> */}
|
||||
<TaxiOrder
|
||||
rqstId = {undefined}
|
||||
/>
|
||||
</AppProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Объект заказа такси
|
||||
*/
|
||||
export interface TaxiOrder_type{
|
||||
id: number | null,
|
||||
emp_login: string | null,
|
||||
emp_phone: string | null,
|
||||
taxi_date: string | null,
|
||||
taxi_time: string | null,
|
||||
taxi_address_from: string | null,
|
||||
taxi_address_to: string | null,
|
||||
cancel_rqst: boolean
|
||||
};
|
||||
|
||||
/**
|
||||
* Тип для отображения данных по заявке на такси в таблице (есть дополнительные поля чисто для отображения)
|
||||
*/
|
||||
export type TaxiOrder_tableData = TaxiOrder_type & {
|
||||
emp_supervisor: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Начальное состояние типа заказа такси
|
||||
*/
|
||||
export const TaxiOrder_initial: TaxiOrder_type = {
|
||||
id: null,
|
||||
emp_login: null,
|
||||
emp_phone: null,
|
||||
taxi_date: null,
|
||||
taxi_time: null,
|
||||
taxi_address_from: null,
|
||||
taxi_address_to: null,
|
||||
cancel_rqst: false
|
||||
};
|
||||
|
||||
/**
|
||||
* Справочник названий полей запроса такси
|
||||
* гаврилов. пересекается со свойством TaxiMain с названием полей. ПОПРАВИТЬ, РЕАЛИЗОВАВ ОБМЕН ТИПАМИ ЧЕРЕЗ СТОРОННИЙ ПАКЕТ
|
||||
*/
|
||||
export const TaxiOrder_fieldName = {
|
||||
id: 'Номер запроса',
|
||||
emp_login: 'Логин сотрудника',
|
||||
emp_supervisor: 'Руководитель',
|
||||
emp_phone: 'Телефон сотрудника',
|
||||
taxi_date: 'Дата заказа',
|
||||
taxi_time: 'Время заказа',
|
||||
taxi_address_from: 'Адрес (откуда)',
|
||||
taxi_address_to: 'Адрес (куда)',
|
||||
cancel_rqst: 'Запрос актуален'
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
@extends('taxi::layouts.master')
|
||||
|
||||
@section('content')
|
||||
<h1>Hello World</h1>
|
||||
|
||||
<p>Module: {!! config('taxi.name') !!}</p>
|
||||
@endsection
|
||||
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<!-- ГАВРИЛОВ. НЕ УВЕРЕН, ЧТО ЭТО НУЖНО -->
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>Taxi Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-taxi', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-taxi', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
||||
@@ -0,0 +1,13 @@
|
||||
@extends('layouts.app_main')
|
||||
|
||||
@section('app_styles')
|
||||
@vite(['Modules/Taxi/resources/css/taxiHome.css'])
|
||||
@endsection
|
||||
|
||||
@section('app_content')
|
||||
<div id="root"></div>
|
||||
@endsection
|
||||
|
||||
@section('app_scripts')
|
||||
@vite(['Modules/Taxi/resources/js/page/taxiHomePage.tsx'])
|
||||
@endsection
|
||||
@@ -0,0 +1,13 @@
|
||||
@extends('layouts.app_main')
|
||||
|
||||
@section('app_styles')
|
||||
@vite(['Modules/Taxi/resources/css/taxiOrder.css'])
|
||||
@endsection
|
||||
|
||||
@section('app_content')
|
||||
<div id="root"></div>
|
||||
@endsection
|
||||
|
||||
@section('app_scripts')
|
||||
@vite(['Modules/Taxi/resources/js/page/taxiOrderPage.tsx'])
|
||||
@endsection
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Taxi\App\Http\Controllers as TaxiControllers;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register API routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| is assigned the "api" middleware group. Enjoy building your API!
|
||||
|
|
||||
*/
|
||||
|
||||
// Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () {
|
||||
// Route::get('taxi', fn (Request $request) => $request->user())->name('taxi');
|
||||
// });
|
||||
|
||||
Route::group([
|
||||
'prefix' => 'taxi',
|
||||
'middleware' => 'checkAppAccess'
|
||||
],
|
||||
function() {
|
||||
Route::group(
|
||||
['middleware' => \Modules\Taxi\App\Http\Middleware\CheckTimeRqstAvailability::class],
|
||||
function() {
|
||||
//Route::post('/createOrder', [TaxiControllers\TaxiController::class, 'createTaxiOrder']);
|
||||
//TODO. Какая будет ошибка, если регулярка не сможет проверить переданные параметр? Можно ли ввести какую-то проверку на уровне роутинга с возвратом конкретной ошибки?
|
||||
// Route::post('/editOrder/{orderId}', [TaxiControllers\TaxiController::class, 'updateTaxiOrder'])->where('orderId', '^[0-9]+$');
|
||||
Route::get('/cancelRqst/{rqstId}', [TaxiControllers\TaxiController::class, 'cancelRqst'])->where('rqstId', '^[0-9]+$');
|
||||
Route::post('/createRqst', [TaxiControllers\TaxiController::class, 'createTaxiOrder']);
|
||||
Route::patch('/editOrder/{orderId}', [TaxiControllers\TaxiController::class, 'updateTaxiOrder'])->where('orderId', '^[0-9]+$');
|
||||
});
|
||||
Route::get('/getActiveOrders', [TaxiControllers\TaxiController::class, 'getActiveOrders']);
|
||||
Route::post('/getFilterOrders', [TaxiControllers\TaxiController::class, 'getFilterOrders']);
|
||||
Route::get('/getEmpInfo/{userLogin}', [TaxiControllers\TaxiController::class, 'getUserInfoByLogin'])->where('userLogin', '^[a-zA-Z_]+[0-9]*$');
|
||||
Route::get('/getOfficeAddress/', [TaxiControllers\TaxiController::class, 'getOfficeAddress']);
|
||||
#Гаврилов
|
||||
//ВЫНЕСТИ ЭТОТ ЕНДПОИНТ ИЗ ГРУППЫ ТАКСИ И ВЫНЕСТИ МЕТОД ПОЛУЧЕНИЯ ВСЕХ ПОЛЬЗОВАТЕЛЕЙ ИЗ СТАРОГО МЭДЖИКА КАКИМ-ТО ОБЩИМ КОНТРОЛЛЕРОМ, СЕРВИСОМ?
|
||||
Route::get('/getEmpInfo/', [TaxiControllers\TaxiController::class, 'getActiveUsersInfo']);
|
||||
//Получаем временные промежутки для заказа такси
|
||||
Route::get('/getTimePeriods/', [TaxiControllers\TaxiController::class, 'getTimePeriods']);
|
||||
//Получаем данные по существующему заказу такси
|
||||
Route::get('/getOrderById/{orderId}', [TaxiControllers\TaxiController::class, 'getOrderById'])->where('orderId', '^[0-9]+$');
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Taxi\App\Http\Controllers as TaxiControllers;
|
||||
use Modules\Taxi\App\Http\Controllers\TaxiController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
Route::group([
|
||||
'prefix' => 'taxi',
|
||||
'middleware' => 'checkAppAccess'
|
||||
],
|
||||
function() {
|
||||
Route::get('/home', function() {
|
||||
return view('taxi::taxi_home');
|
||||
})->name('taxi_home');
|
||||
#Гаврилов
|
||||
//УБЕРИ ЕНДПОИНТ
|
||||
Route::get('/checkredis', [TaxiControllers\TaxiController::class, 'testRedisMethod']);
|
||||
#Гаврилов
|
||||
//ПОСРЕДНИК АУТЕНТИФИКАЦИИ ЗДЕСЬ БУДЕТ СРАБАТЫВАТЬ?
|
||||
//внедри внутри роута проверку существует ли запрос и можно ли его редачить (заказ на сегодня + время отправки еще не подошло, либо заказ на завтра)
|
||||
Route::group(['middleware' => \Modules\Taxi\App\Http\Middleware\CheckTimeRqstAvailability::class], function() {
|
||||
Route::get('/editOrder/{orderId}', function() {
|
||||
return view('taxi::taxi_order');
|
||||
})->where('orderId', '^[0-9]+$');
|
||||
Route::post('/createRqst', [TaxiControllers\TaxiController::class, 'createTaxiOrder']);
|
||||
Route::post('/editOrder/{orderId}', [TaxiControllers\TaxiController::class, 'updateTaxiOrder'])->where('orderId', '^[0-9]+$');
|
||||
Route::get('/createRqst', function() {
|
||||
return view('taxi::taxi_order');
|
||||
})->middleware('checkPermission:admin'); //ГАВРИЛОВ. НЕ ЗАБУДЬ УБРАТЬ ДОСТУП К ЭТОМУ РОУТУ ДЛЯ АДМИНОВ, ОН ДОСТУПЕН ДЛЯ ВСЕХ
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: '../../public/build-taxi',
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
publicDirectory: '../../public',
|
||||
buildDirectory: 'build-taxi',
|
||||
input: [
|
||||
__dirname + '/resources/assets/sass/app.scss',
|
||||
__dirname + '/resources/assets/js/app.js'
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
//export const paths = [
|
||||
// 'Modules/$STUDLY_NAME$/resources/assets/sass/app.scss',
|
||||
// 'Modules/$STUDLY_NAME$/resources/assets/js/app.js',
|
||||
//];
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
//activity()->log('Look mum, I logged something');
|
||||
#Гаврилов
|
||||
//ПРОВЕРИТЬ, РАБОТАЕТ?
|
||||
// $schedule->command('sanctum:prune-expired --hours=24')
|
||||
// ->daily();
|
||||
//->dailyAt('21:03');
|
||||
// activity()
|
||||
// ->byAnonymous()
|
||||
// ->inLog('Shedule')
|
||||
// ->event('clear_old_Sanctum_tokens');
|
||||
|
||||
//попытка поработать с командами по расписанию. Не успел протестить. В частности, в этом скрипте планируется в определенное время инициировать отправку всех заявок на такси
|
||||
$schedule->command('taxi:send-today-orders-mail')->dailyAt('08:00');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*/
|
||||
protected function commands(): void
|
||||
{
|
||||
$this->load(__DIR__ . '/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use App\Http\Middleware\CheckUserAppAccess;
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array<int, class-string|string>
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Illuminate\Http\Middleware\HandleCors::class,
|
||||
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array<string, array<int, class-string|string>>
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\App\Http\Middleware\AuthenticateMagic::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
//\Illuminate\Session\Middleware\StartSession::class,
|
||||
//\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
//\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
//\Illuminate\Session\Middleware\AuthenticateSession::class, // Опционально
|
||||
//\Illuminate\Auth\Middleware\Authenticate::class.':sanctum', // Глобальная аутентификация
|
||||
//Кастомный посредник аутентификации, который наследует стандартному посреднику аутентификации с передачей guarda sanctum. Сначала в кастомном посреднике будет проведена аутентификация sanctum, если будет выброшена ошибка, она будет обработана кастомным посредником (с возвратом сообщения об ошибке и корректного статуса). Без этой реализации стандартный посредник аутентификации пытался редиректить на роут login, которого не должно быть при обращении к api ендпоинту
|
||||
\App\Http\Middleware\AuthenticateMagicApi::class.':sanctum',
|
||||
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's middleware aliases.
|
||||
*
|
||||
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
|
||||
*
|
||||
* @var array<string, class-string|string>
|
||||
*/
|
||||
protected $middlewareAliases = [
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
|
||||
'signed' => \App\Http\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
//Посредник проверки доступных ролей в приложении
|
||||
'checkPermission' => \App\Http\Middleware\CheckUserPermission::class,
|
||||
//Посредник проверки доступа к приложению
|
||||
'checkAppAccess' => \App\Http\Middleware\CheckUserAppAccess::class,
|
||||
];
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||
|
||||
class PreventRequestsDuringMaintenance extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be reachable while maintenance mode is enabled.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, string ...$guards): Response
|
||||
{
|
||||
$guards = empty($guards) ? [null] : $guards;
|
||||
|
||||
foreach ($guards as $guard) {
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the host patterns that should be trusted.
|
||||
*
|
||||
* @return array<int, string|null>
|
||||
*/
|
||||
public function hosts(): array
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array<int, string>|string|null
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OldMagicModels;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CcEmp extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'cc_emp';
|
||||
protected $connection = 'magic_old';
|
||||
}
|
||||
@@ -1,53 +1,18 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any of our classes manually. It's great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the command...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run The Artisan Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When we run the console application, the current CLI command will be
|
||||
| executed in this console and the response sent back to a terminal
|
||||
| or another output device for the developers. Here goes nothing!
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
|
||||
$status = $kernel->handle(
|
||||
$input = new Symfony\Component\Console\Input\ArgvInput,
|
||||
new Symfony\Component\Console\Output\ConsoleOutput
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Shutdown The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once Artisan has finished running, we will fire off the shutdown events
|
||||
| so that any final work may be done by the application before we shut
|
||||
| down the process. This is the last thing to happen to the request.
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel->terminate($input, $status);
|
||||
$status = $app->handleCommand(new ArgvInput);
|
||||
|
||||
exit($status);
|
||||
|
||||
+15
-52
@@ -1,55 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
|
||||
$app = new Illuminate\Foundation\Application(
|
||||
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bind Important Interfaces
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, we need to bind some important interfaces into the container so
|
||||
| we will be able to resolve them when needed. The kernels serve the
|
||||
| incoming requests to this application from both the web and CLI.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Http\Kernel::class,
|
||||
App\Http\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Console\Kernel::class,
|
||||
App\Console\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Debug\ExceptionHandler::class,
|
||||
App\Exceptions\Handler::class
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This script returns the application instance. The instance is given to
|
||||
| the calling script so we can separate the building of the instances
|
||||
| from the actual running of the application and sending responses.
|
||||
|
|
||||
*/
|
||||
|
||||
return $app;
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
//
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
})->create();
|
||||
|
||||
+33
-19
@@ -1,34 +1,27 @@
|
||||
{
|
||||
"$schema": "https://getcomposer.org/schema.json",
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The skeleton application for the Laravel framework.",
|
||||
"keywords": ["laravel", "framework"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"directorytree/ldaprecord-laravel": "^3.4",
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"laravel/framework": "^10.10",
|
||||
"laravel/sanctum": "^3.3",
|
||||
"laravel/tinker": "^2.8",
|
||||
"laravel/ui": "^4.6",
|
||||
"nwidart/laravel-modules": "^10.0",
|
||||
"spatie/laravel-activitylog": "^4.10"
|
||||
"php": "^8.2",
|
||||
"laravel/framework": "^12.0",
|
||||
"laravel/tinker": "^2.10.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"laravel/pint": "^1.0",
|
||||
"laravel/sail": "^1.18",
|
||||
"mockery/mockery": "^1.4.4",
|
||||
"nunomaduro/collision": "^7.0",
|
||||
"php-debugbar/php-debugbar": "^2.1",
|
||||
"phpunit/phpunit": "^10.1",
|
||||
"spatie/laravel-ignition": "^2.0"
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pail": "^1.2.2",
|
||||
"laravel/pint": "^1.24",
|
||||
"laravel/sail": "^1.41",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.6",
|
||||
"phpunit/phpunit": "^11.5.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Modules\\": "Modules/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
@@ -39,6 +32,22 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"setup": [
|
||||
"composer install",
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||
"@php artisan key:generate",
|
||||
"@php artisan migrate --force",
|
||||
"npm install",
|
||||
"npm run build"
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
|
||||
],
|
||||
"test": [
|
||||
"@php artisan config:clear --ansi",
|
||||
"@php artisan test"
|
||||
],
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
@@ -50,7 +59,12 @@
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi"
|
||||
"@php artisan key:generate --ansi",
|
||||
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
||||
"@php artisan migrate --graceful --ansi"
|
||||
],
|
||||
"pre-package-uninstall": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
|
||||
Generated
+1783
-2041
File diff suppressed because it is too large
Load Diff
+23
-92
@@ -1,8 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
@@ -10,9 +7,9 @@ return [
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application. This value is used when the
|
||||
| This value is the name of your application, which will be used when the
|
||||
| framework needs to place the application's name in a notification or
|
||||
| any other location as required by the application or its packages.
|
||||
| other UI elements where an application name needs to be displayed.
|
||||
|
|
||||
*/
|
||||
|
||||
@@ -51,28 +48,24 @@ return [
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
| the application so that it's available within Artisan commands.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
'asset_url' => env('ASSET_URL'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. We have gone
|
||||
| ahead and set this to a sensible default for you out of the box.
|
||||
| will be used by the PHP date and date-time functions. The timezone
|
||||
| is set to "UTC" by default as it is suitable for most use cases.
|
||||
|
|
||||
*/
|
||||
|
||||
#Гаврилов
|
||||
//ПОМЕНЯТЬ НА ПРОДЕ
|
||||
'timezone' => 'Europe/Moscow',
|
||||
'timezone' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -80,54 +73,37 @@ return [
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by the translation service provider. You are free to set this value
|
||||
| to any of the locales which will be supported by the application.
|
||||
| by Laravel's translation / localization methods. This option can be
|
||||
| set to any locale for which you plan to have translation strings.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => 'ru',
|
||||
'fallback_locale' => 'en', // Резервный язык (если перевод отсутствует)
|
||||
'locale' => env('APP_LOCALE', 'en'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Fallback Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The fallback locale determines the locale to use when the current one
|
||||
| is not available. You may change the value to correspond to any of
|
||||
| the language folders that are provided through your application.
|
||||
|
|
||||
*/
|
||||
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
||||
|
||||
'fallback_locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Faker Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This locale will be used by the Faker PHP library when generating fake
|
||||
| data for your database seeds. For example, this will be used to get
|
||||
| localized telephone numbers, street address information and more.
|
||||
|
|
||||
*/
|
||||
|
||||
'faker_locale' => 'en_US',
|
||||
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
| This key is utilized by Laravel's encryption services and should be set
|
||||
| to a random, 32 character string to ensure that all encrypted values
|
||||
| are secure. You should do this prior to deploying the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
'previous_keys' => [
|
||||
...array_filter(
|
||||
explode(',', (string) env('APP_PREVIOUS_KEYS', ''))
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -143,53 +119,8 @@ return [
|
||||
*/
|
||||
|
||||
'maintenance' => [
|
||||
'driver' => 'file',
|
||||
// 'store' => 'redis',
|
||||
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
|
||||
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Autoloaded Service Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The service providers listed here will be automatically loaded on the
|
||||
| request to your application. Feel free to add your own services to
|
||||
| this array to grant expanded functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => ServiceProvider::defaultProviders()->merge([
|
||||
/*
|
||||
* Package Service Providers...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Application Service Providers...
|
||||
*/
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
App\Providers\AuthorizationServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
])->toArray(),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Class Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array of class aliases will be registered when this application
|
||||
| is started. However, feel free to register as many as you wish as
|
||||
| the aliases are "lazy" loaded so they don't hinder performance.
|
||||
|
|
||||
*/
|
||||
|
||||
'aliases' => Facade::defaultAliases()->merge([
|
||||
// 'Example' => App\Facades\Example::class,
|
||||
])->toArray(),
|
||||
|
||||
'test_env' => env('TEST_ENV'),
|
||||
//Время жизни сессии
|
||||
'session_life_time' => env('SESSION_LIFETIME'),
|
||||
];
|
||||
|
||||
+22
-16
@@ -9,13 +9,13 @@ return [
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache connection that gets used while
|
||||
| using this caching library. This connection is used when another is
|
||||
| not explicitly specified when executing a given caching function.
|
||||
| This option controls the default cache store that will be used by the
|
||||
| framework. This connection is utilized if another isn't explicitly
|
||||
| specified when running a cache operation inside the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_DRIVER', 'file'),
|
||||
'default' => env('CACHE_STORE', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -26,17 +26,14 @@ return [
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "apc", "array", "database", "file",
|
||||
| "memcached", "redis", "dynamodb", "octane", "null"
|
||||
| Supported drivers: "array", "database", "file", "memcached",
|
||||
| "redis", "dynamodb", "octane",
|
||||
| "failover", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
||||
'apc' => [
|
||||
'driver' => 'apc',
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
@@ -44,9 +41,10 @@ return [
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'cache',
|
||||
'connection' => null,
|
||||
'lock_connection' => null,
|
||||
'connection' => env('DB_CACHE_CONNECTION'),
|
||||
'table' => env('DB_CACHE_TABLE', 'cache'),
|
||||
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
|
||||
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
|
||||
],
|
||||
|
||||
'file' => [
|
||||
@@ -93,6 +91,14 @@ return [
|
||||
'driver' => 'octane',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'driver' => 'failover',
|
||||
'stores' => [
|
||||
'database',
|
||||
'array',
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
@@ -100,12 +106,12 @@ return [
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
|
||||
| stores there might be other applications using the same cache. For
|
||||
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
|
||||
| stores, there might be other applications using the same cache. For
|
||||
| that reason, you may prefix every cache key to avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'),
|
||||
|
||||
];
|
||||
|
||||
+43
-40
@@ -10,26 +10,22 @@ return [
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
| to use as your default connection for database operations. This is
|
||||
| the connection which will be utilized unless another connection
|
||||
| is explicitly specified when you execute a query / statement.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'mysql'),
|
||||
'default' => env('DB_CONNECTION', 'sqlite'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
| Below are all of the database connections defined for your application.
|
||||
| An example configuration is provided for each database system which
|
||||
| is supported by Laravel. You're free to add / remove connections.
|
||||
|
|
||||
*/
|
||||
|
||||
@@ -37,76 +33,80 @@ return [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'url' => env('DB_URL'),
|
||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||
'prefix' => '',
|
||||
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||
'busy_timeout' => null,
|
||||
'journal_mode' => null,
|
||||
'synchronous' => null,
|
||||
'transaction_mode' => 'DEFERRED',
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'magic_old' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_OLD_HOST'),
|
||||
'port' => env('DB_OLD_PORT', '3306'),
|
||||
'database' => env('DB_OLD_DATABASE'),
|
||||
'username' => env('DB_OLD_USERNAME'),
|
||||
'password' => env('DB_OLD_PASSWORD'),
|
||||
'unix_socket' => env('DB_OLD_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'mariadb' => [
|
||||
'driver' => 'mariadb',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
'sslmode' => env('DB_SSLMODE', 'prefer'),
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1433'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||
@@ -122,11 +122,14 @@ return [
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run in the database.
|
||||
| the migrations on disk haven't actually been run on the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
'migrations' => [
|
||||
'table' => 'migrations',
|
||||
'update_date_on_publish' => true,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
+11
-7
@@ -9,7 +9,7 @@ return [
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. The "local" disk, as well as a variety of cloud
|
||||
| based disks are available to your application. Just store away!
|
||||
| based disks are available to your application for file storage.
|
||||
|
|
||||
*/
|
||||
|
||||
@@ -20,11 +20,11 @@ return [
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| been set up for each driver as an example of the required values.
|
||||
| Below you may configure as many filesystem disks as necessary, and you
|
||||
| may even configure multiple disks for the same driver. Examples for
|
||||
| most supported storage drivers are configured here for reference.
|
||||
|
|
||||
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||
| Supported drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
@@ -32,16 +32,19 @@ return [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app'),
|
||||
'root' => storage_path('app/private'),
|
||||
'serve' => true,
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage',
|
||||
'visibility' => 'public',
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
's3' => [
|
||||
@@ -54,6 +57,7 @@ return [
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hash Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default hash driver that will be used to hash
|
||||
| passwords for your application. By default, the bcrypt algorithm is
|
||||
| used; however, you remain free to modify this option if you wish.
|
||||
|
|
||||
| Supported: "bcrypt", "argon", "argon2id"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bcrypt Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Bcrypt algorithm. This will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'bcrypt' => [
|
||||
'rounds' => env('BCRYPT_ROUNDS', 12),
|
||||
'verify' => true,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argon Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Argon algorithm. These will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 65536,
|
||||
'threads' => 1,
|
||||
'time' => 4,
|
||||
'verify' => true,
|
||||
],
|
||||
|
||||
];
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| View Storage Paths
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Most templating systems load templates from disk. Here you may specify
|
||||
| an array of paths that should be checked for your views. Of course
|
||||
| the usual Laravel view path has already been registered for you.
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => [
|
||||
resource_path('views'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Compiled View Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines where all the compiled Blade templates will be
|
||||
| stored for your application. Typically, this is within the storage
|
||||
| directory. However, as usual, you are free to change this value.
|
||||
|
|
||||
*/
|
||||
|
||||
'compiled' => env(
|
||||
'VIEW_COMPILED_PATH',
|
||||
realpath(storage_path('framework/views'))
|
||||
),
|
||||
|
||||
];
|
||||
@@ -1,191 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| as the size rules. Feel free to tweak each of these messages here.
|
||||
|
|
||||
*/
|
||||
|
||||
'accepted' => 'Поле :attribute должно быть принято.',
|
||||
'accepted_if' => 'The :attribute field must be accepted when :other is :value.',
|
||||
'active_url' => 'The :attribute field must be a valid URL.',
|
||||
'after' => 'The :attribute field must be a date after :date.',
|
||||
'after_or_equal' => 'The :attribute field must be a date after or equal to :date.',
|
||||
'alpha' => 'The :attribute field must only contain letters.',
|
||||
'alpha_dash' => 'The :attribute field must only contain letters, numbers, dashes, and underscores.',
|
||||
'alpha_num' => 'The :attribute field must only contain letters and numbers.',
|
||||
'array' => 'The :attribute field must be an array.',
|
||||
'ascii' => 'The :attribute field must only contain single-byte alphanumeric characters and symbols.',
|
||||
'before' => 'The :attribute field must be a date before :date.',
|
||||
'before_or_equal' => 'The :attribute field must be a date before or equal to :date.',
|
||||
'between' => [
|
||||
'array' => 'The :attribute field must have between :min and :max items.',
|
||||
'file' => 'The :attribute field must be between :min and :max kilobytes.',
|
||||
'numeric' => 'The :attribute field must be between :min and :max.',
|
||||
'string' => 'The :attribute field must be between :min and :max characters.',
|
||||
],
|
||||
'boolean' => 'The :attribute field must be true or false.',
|
||||
'can' => 'The :attribute field contains an unauthorized value.',
|
||||
'confirmed' => 'The :attribute field confirmation does not match.',
|
||||
'current_password' => 'The password is incorrect.',
|
||||
'date' => 'The :attribute field must be a valid date.',
|
||||
'date_equals' => 'The :attribute field must be a date equal to :date.',
|
||||
'date_format' => 'Некорректный формат поля :attribute. Допускается следующий формат: :format.',
|
||||
'decimal' => 'The :attribute field must have :decimal decimal places.',
|
||||
'declined' => 'The :attribute field must be declined.',
|
||||
'declined_if' => 'The :attribute field must be declined when :other is :value.',
|
||||
'different' => 'The :attribute field and :other must be different.',
|
||||
'digits' => 'The :attribute field must be :digits digits.',
|
||||
'digits_between' => 'The :attribute field must be between :min and :max digits.',
|
||||
'dimensions' => 'The :attribute field has invalid image dimensions.',
|
||||
'distinct' => 'The :attribute field has a duplicate value.',
|
||||
'doesnt_end_with' => 'The :attribute field must not end with one of the following: :values.',
|
||||
'doesnt_start_with' => 'The :attribute field must not start with one of the following: :values.',
|
||||
'email' => 'The :attribute field must be a valid email address.',
|
||||
'ends_with' => 'The :attribute field must end with one of the following: :values.',
|
||||
'enum' => 'The selected :attribute is invalid.',
|
||||
'exists' => 'The selected :attribute is invalid.',
|
||||
'extensions' => 'The :attribute field must have one of the following extensions: :values.',
|
||||
'file' => 'The :attribute field must be a file.',
|
||||
'filled' => 'The :attribute field must have a value.',
|
||||
'gt' => [
|
||||
'array' => 'The :attribute field must have more than :value items.',
|
||||
'file' => 'The :attribute field must be greater than :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be greater than :value.',
|
||||
'string' => 'The :attribute field must be greater than :value characters.',
|
||||
],
|
||||
'gte' => [
|
||||
'array' => 'The :attribute field must have :value items or more.',
|
||||
'file' => 'The :attribute field must be greater than or equal to :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be greater than or equal to :value.',
|
||||
'string' => 'The :attribute field must be greater than or equal to :value characters.',
|
||||
],
|
||||
'hex_color' => 'The :attribute field must be a valid hexadecimal color.',
|
||||
'image' => 'The :attribute field must be an image.',
|
||||
'in' => 'Недопустимое значение поля :attribute.',
|
||||
'in_array' => 'The :attribute field must exist in :other.',
|
||||
'integer' => 'The :attribute field must be an integer.',
|
||||
'ip' => 'The :attribute field must be a valid IP address.',
|
||||
'ipv4' => 'The :attribute field must be a valid IPv4 address.',
|
||||
'ipv6' => 'The :attribute field must be a valid IPv6 address.',
|
||||
'json' => 'The :attribute field must be a valid JSON string.',
|
||||
'lowercase' => 'The :attribute field must be lowercase.',
|
||||
'lt' => [
|
||||
'array' => 'The :attribute field must have less than :value items.',
|
||||
'file' => 'The :attribute field must be less than :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be less than :value.',
|
||||
'string' => 'The :attribute field must be less than :value characters.',
|
||||
],
|
||||
'lte' => [
|
||||
'array' => 'The :attribute field must not have more than :value items.',
|
||||
'file' => 'The :attribute field must be less than or equal to :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be less than or equal to :value.',
|
||||
'string' => 'The :attribute field must be less than or equal to :value characters.',
|
||||
],
|
||||
'mac_address' => 'The :attribute field must be a valid MAC address.',
|
||||
'max' => [
|
||||
'array' => 'The :attribute field must not have more than :max items.',
|
||||
'file' => 'The :attribute field must not be greater than :max kilobytes.',
|
||||
'numeric' => 'The :attribute field must not be greater than :max.',
|
||||
'string' => 'Значение поля :attribute не должно быть больше :max символов.',
|
||||
],
|
||||
'max_digits' => 'The :attribute field must not have more than :max digits.',
|
||||
'mimes' => 'The :attribute field must be a file of type: :values.',
|
||||
'mimetypes' => 'The :attribute field must be a file of type: :values.',
|
||||
'min' => [
|
||||
'array' => 'The :attribute field must have at least :min items.',
|
||||
'file' => 'The :attribute field must be at least :min kilobytes.',
|
||||
'numeric' => 'The :attribute field must be at least :min.',
|
||||
'string' => 'The :attribute field must be at least :min characters.',
|
||||
],
|
||||
'min_digits' => 'The :attribute field must have at least :min digits.',
|
||||
'missing' => 'The :attribute field must be missing.',
|
||||
'missing_if' => 'The :attribute field must be missing when :other is :value.',
|
||||
'missing_unless' => 'The :attribute field must be missing unless :other is :value.',
|
||||
'missing_with' => 'The :attribute field must be missing when :values is present.',
|
||||
'missing_with_all' => 'The :attribute field must be missing when :values are present.',
|
||||
'multiple_of' => 'The :attribute field must be a multiple of :value.',
|
||||
'not_in' => 'The selected :attribute is invalid.',
|
||||
'not_regex' => 'The :attribute field format is invalid.',
|
||||
'numeric' => 'The :attribute field must be a number.',
|
||||
'password' => [
|
||||
'letters' => 'The :attribute field must contain at least one letter.',
|
||||
'mixed' => 'The :attribute field must contain at least one uppercase and one lowercase letter.',
|
||||
'numbers' => 'The :attribute field must contain at least one number.',
|
||||
'symbols' => 'The :attribute field must contain at least one symbol.',
|
||||
'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
|
||||
],
|
||||
'present' => 'The :attribute field must be present.',
|
||||
'present_if' => 'The :attribute field must be present when :other is :value.',
|
||||
'present_unless' => 'The :attribute field must be present unless :other is :value.',
|
||||
'present_with' => 'The :attribute field must be present when :values is present.',
|
||||
'present_with_all' => 'The :attribute field must be present when :values are present.',
|
||||
'prohibited' => 'Поле :attribute не должно передаваться.',
|
||||
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
|
||||
'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
|
||||
'prohibits' => 'The :attribute field prohibits :other from being present.',
|
||||
'regex' => 'Недопустимый формат поля :attribute.',
|
||||
'required' => 'Поле :attribute обязательно должно быть заполнено.',
|
||||
'required_array_keys' => 'The :attribute field must contain entries for: :values.',
|
||||
'required_if' => 'The :attribute field is required when :other is :value.',
|
||||
'required_if_accepted' => 'The :attribute field is required when :other is accepted.',
|
||||
'required_unless' => 'The :attribute field is required unless :other is in :values.',
|
||||
'required_with' => 'The :attribute field is required when :values is present.',
|
||||
'required_with_all' => 'The :attribute field is required when :values are present.',
|
||||
'required_without' => 'The :attribute field is required when :values is not present.',
|
||||
'required_without_all' => 'The :attribute field is required when none of :values are present.',
|
||||
'same' => 'The :attribute field must match :other.',
|
||||
'size' => [
|
||||
'array' => 'The :attribute field must contain :size items.',
|
||||
'file' => 'The :attribute field must be :size kilobytes.',
|
||||
'numeric' => 'The :attribute field must be :size.',
|
||||
'string' => 'The :attribute field must be :size characters.',
|
||||
],
|
||||
'starts_with' => 'The :attribute field must start with one of the following: :values.',
|
||||
'string' => 'The :attribute field must be a string.',
|
||||
'timezone' => 'The :attribute field must be a valid timezone.',
|
||||
'unique' => 'The :attribute has already been taken.',
|
||||
'uploaded' => 'The :attribute failed to upload.',
|
||||
'uppercase' => 'The :attribute field must be uppercase.',
|
||||
'url' => 'The :attribute field must be a valid URL.',
|
||||
'ulid' => 'The :attribute field must be a valid ULID.',
|
||||
'uuid' => 'The :attribute field must be a valid UUID.',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify custom validation messages for attributes using the
|
||||
| convention "attribute.rule" to name the lines. This makes it quick to
|
||||
| specify a specific custom language line for a given attribute rule.
|
||||
|
|
||||
*/
|
||||
|
||||
'custom' => [
|
||||
'attribute-name' => [
|
||||
'rule-name' => 'custom-message',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Attributes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used to swap our attribute placeholder
|
||||
| with something more reader friendly such as "E-Mail Address" instead
|
||||
| of "email". This simply helps us make our message more expressive.
|
||||
|
|
||||
*/
|
||||
|
||||
'attributes' => [],
|
||||
|
||||
];
|
||||
Generated
-3555
File diff suppressed because it is too large
Load Diff
+9
-30
@@ -1,38 +1,17 @@
|
||||
{
|
||||
"$schema": "https://www.schemastore.org/package.json",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
"build": "vite build",
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"@types/react": "^19.1.8",
|
||||
"@types/react-dom": "^19.1.6",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"axios": "^1.13.2",
|
||||
"bootstrap": "^5.2.3",
|
||||
"globby": "^14.1.0",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"resolve-url-loader": "^5.0.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@date-io/date-fns": "^2.14.0",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@fortawesome/fontawesome-free": "^7.0.1",
|
||||
"@mui/material": "^5.18.0",
|
||||
"@mui/x-tree-view": "^6.17.0",
|
||||
"@SharePoint/rencredit_uikit": "^1.0.234",
|
||||
"date-fns": "^2.30.0",
|
||||
"dompurify": "^3.2.6",
|
||||
"react-dropzone": "^14.3.8",
|
||||
"react-imask": "^6.6.3",
|
||||
"react-number-format": "^5.4.4",
|
||||
"uuid": "^9.0.0"
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"axios": "^1.11.0",
|
||||
"concurrently": "^9.0.1",
|
||||
"laravel-vite-plugin": "^2.0.0",
|
||||
"tailwindcss": "^4.0.0",
|
||||
"vite": "^7.0.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
RewriteCond %{HTTP:Authorization} .
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
|
||||
# Handle X-XSRF-Token Header
|
||||
RewriteCond %{HTTP:x-xsrf-token} .
|
||||
RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
|
||||
|
||||
# Redirect Trailing Slashes If Not A Folder...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} (.+)/$
|
||||
|
||||
@@ -1,664 +0,0 @@
|
||||
<mxfile>
|
||||
<diagram id="YrEqY51DlFa1ZGKHTR-x" name="Страница — 1">
|
||||
<mxGraphModel dx="1852" dy="1862" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="10" value="Middleware\web\<br>AuthetnticateMagic" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="370" y="10" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="12" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="18" target="10" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="430" y="170" as="sourcePoint" />
|
||||
<mxPoint x="205" y="70" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="18" value="Сессия <br>стартована" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="375" y="200" width="110" height="70" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="20" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#000000;fillColor=#d5e8d4;strokeWidth=1;" parent="1" source="18" target="28" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="510" y="280" as="sourcePoint" />
|
||||
<mxPoint x="540" y="350" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="21" value="Да" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" parent="20" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="12" y="-2" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="23" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#fff2cc;strokeColor=#000000;strokeWidth=1;" parent="1" source="18" target="77" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="250" y="360" as="sourcePoint" />
|
||||
<mxPoint x="320" y="350" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="24" value="Нет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" parent="23" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="17" y="-77" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="29" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0;exitY=0.5;exitDx=0;exitDy=0;strokeColor=light-dark(#000000, #446e2c);fillColor=#d5e8d4;strokeWidth=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="28" target="31" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="460" y="590" as="sourcePoint" />
|
||||
<mxPoint x="420" y="520" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="30" value="Нет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" parent="29" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="-30" y="-14" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="31" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="347.5" y="440" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="33" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=1;edgeStyle=orthogonalEdgeStyle;" parent="1" source="31" target="77" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="440" y="1075" as="sourcePoint" />
|
||||
<mxPoint x="205" y="560" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="36" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fillColor=#fff2cc;strokeColor=#000000;strokeWidth=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="28" target="39" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="665" y="580" as="sourcePoint" />
|
||||
<mxPoint x="670" y="560" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="37" value="Да" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" parent="36" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="14" y="-27" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="38" value="Controller\<br>LoginController" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="740" y="10" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="39" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="420" y="500" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="40" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" parent="1" source="39" target="43" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="825" y="620" as="sourcePoint" />
|
||||
<mxPoint x="840" y="560" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="41" value="Проводим аутентификацию<br>&nbsp;через LDAP" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="40" vertex="1" connectable="0">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-130" y="-22" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="43" value="Аутентификация <br>LDAP успешна" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="728.75" y="560" width="142.5" height="70" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="44" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=light-dark(#000000, #446e2c);fillColor=#d5e8d4;strokeWidth=1;" parent="1" source="43" target="51" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="880" y="660" as="sourcePoint" />
|
||||
<mxPoint x="918" y="720" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="45" value="Да" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" parent="44" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="-28" y="-7" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="46" value="" style="endArrow=classicThin;html=1;edgeStyle=orthogonalEdgeStyle;fillColor=#fff2cc;strokeColor=light-dark(#000000, #6d5100);strokeWidth=1;endFill=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="43" target="77" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="770" y="640" as="sourcePoint" />
|
||||
<mxPoint x="849.375" y="685" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="760" y="595" />
|
||||
<mxPoint x="760" y="595" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="47" value="Нет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" parent="46" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="118" y="-18" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="50" value="Session" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="1100" y="10" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="51" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="789.38" y="665" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="52" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="1150" y="665" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="53" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="51" target="52" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1000" y="674.5" as="sourcePoint" />
|
||||
<mxPoint x="1170" y="674.5" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="54" value="Помещаем логин и <br>группы пользователя <br>в сессию" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="53" vertex="1" connectable="0">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-83" y="-27" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="55" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="150" target="136" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="920" y="850" as="sourcePoint" />
|
||||
<mxPoint x="909" y="820" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="60" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="1150" y="315" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="65" value="" style="endArrow=classic;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;startArrow=classic;startFill=1;" parent="1" source="60" target="28" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="760" as="sourcePoint" />
|
||||
<mxPoint x="550" y="380" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="66" value="web/api" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-240" y="95" width="80" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="67" value="Middleware\web\<br>AuthetnticateMagicApi" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="130" y="5" width="135" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="70" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="187.5" y="115" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="71" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="70" target="67">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="250" y="230" as="sourcePoint" />
|
||||
<mxPoint x="240" y="100" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="72" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="66" target="70">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="110" y="120" as="sourcePoint" />
|
||||
<mxPoint x="90" y="200" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="73" value="api ендпоинт" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="72">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-156" y="-12" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="74" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;jumpStyle=arc;" edge="1" parent="1" source="66" target="18">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="130" y="160" as="sourcePoint" />
|
||||
<mxPoint x="420" y="190" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="75" value="web роут" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="74">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-317" y="-14" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="76" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="155" target="70">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="245" y="500" as="sourcePoint" />
|
||||
<mxPoint x="244.5" y="220" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="77" value="views\login" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="240" y="585" width="140" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="87" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="43" target="38">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="800" y="530" as="sourcePoint" />
|
||||
<mxPoint x="390" y="80" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="88" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="60" target="50">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="860" y="540" as="sourcePoint" />
|
||||
<mxPoint x="860" y="80" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="1160" y="220" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="89" value="" style="endArrow=none;dashed=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="113" target="52">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1170" y="385" as="sourcePoint" />
|
||||
<mxPoint x="1150" y="510" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="141" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.375;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;endArrow=none;endFill=0;dashed=1;" edge="1" parent="1" source="90" target="142">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1560" y="40" as="sourcePoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="90" value="users" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
|
||||
<mxGeometry x="1490" width="60" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="91" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="92" target="90">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1260" y="600" as="sourcePoint" />
|
||||
<mxPoint x="1100" y="80" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="205" value="" style="edgeStyle=none;html=1;dashed=1;endArrow=none;endFill=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="92" target="206">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1537.2727272727275" y="930" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="92" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1510" y="745" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="96" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="790" y="745" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="97" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="96" target="51">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="930" y="850" as="sourcePoint" />
|
||||
<mxPoint x="930" y="660" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="98" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;" edge="1" parent="1" source="96" target="92">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="640" as="sourcePoint" />
|
||||
<mxPoint x="1160" y="640" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="99" value="Создаем запись с логином пользователя в модели users, <br>если аутентификация проходит впервые<br>(нужно для работы Sanctum)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=light-dark(#FFFFFF,#EDEDED);" vertex="1" connectable="0" parent="98">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-235" y="-27" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="101" value="personal_access_tokens" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
|
||||
<mxGeometry x="1640" y="5" width="160" height="70" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="102" value="модель с токенами <br>доступа Sanctum" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="1655" y="-40" width="130" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="137" value="" style="edgeStyle=none;html=1;endArrow=none;endFill=0;" edge="1" parent="1" source="103" target="136">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="103" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="789.38" y="860" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="104" value="" style="endArrow=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="96" target="103">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="930" y="970" as="sourcePoint" />
|
||||
<mxPoint x="1020" y="890" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="105" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="106" target="101">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1320" y="730" as="sourcePoint" />
|
||||
<mxPoint x="1320" y="80" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="193" value="" style="edgeStyle=none;html=1;endArrow=none;endFill=0;dashed=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="106" target="194">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1720" y="930" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="106" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1710" y="860" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="107" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;" edge="1" parent="1" source="103" target="106">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="750" as="sourcePoint" />
|
||||
<mxPoint x="1380" y="750" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="108" value="Создаем запись с токеном доступа Sanctum.<br>Их надо указывать если делается запрос к api.<br>Если запрос делается с фронта (через fetch, например), <br>токен подставится в заголовки автоматически на бэке" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="107">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-349" y="-32" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="114" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;jumpStyle=arc;" edge="1" parent="1" source="31" target="113">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="440" y="1040" as="sourcePoint" />
|
||||
<mxPoint x="1122" y="920" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="115" value="Кладем в сессию параметр _<b><font style="font-size: 13px;">auth_prev_page</font></b> со значением URL, <br>на который&nbsp;<span style="color: rgb(0, 0, 0);">перекинем пользователя&nbsp;</span>после аутентификации&nbsp;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="114">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-259" y="-22" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="220" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="117" target="132">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="717" y="1320" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="117" value="views\menu" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="600" y="1247" width="120" height="34.5" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="120" value="адрес страницы <br>есть?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="728.13" y="1115" width="142.5" height="70" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="121" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="1130" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="122" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="134" target="121">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1170" y="900" as="sourcePoint" />
|
||||
<mxPoint x="1170" y="660" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="123" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;startArrow=classic;startFill=1;" edge="1" parent="1" source="120" target="121">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="750" as="sourcePoint" />
|
||||
<mxPoint x="1380" y="750" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="124" value="Запрашиваем url страницы <br>откуда пришел пользователь<br><b><font style="font-size: 13px;">auth_prev_page</font></b>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;textShadow=0;" vertex="1" connectable="0" parent="123">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-49" y="-37" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="126" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="688.75" y="1115" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="128" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="130" target="120">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="918.62" y="1238" as="sourcePoint" />
|
||||
<mxPoint x="921" y="1190" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="133" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="130" target="132">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="801" y="1337" />
|
||||
<mxPoint x="725" y="1337" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="130" value="views\{url}" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="740" y="1246.5" width="121.25" height="33.5" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="131" value="Редирект на url откуда <br>пришел пользователь" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="860" y="1243.25" width="150" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="132" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="700" y="1390" width="50" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="134" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="940" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="136" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="790" y="940" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="138" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;startArrow=none;startFill=0;" edge="1" parent="1" source="136" target="134">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1051" y="1094" as="sourcePoint" />
|
||||
<mxPoint x="1160" y="1094" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="139" value="Кладем в сессию <br>параметр <font style="font-size: 13px;"><b>is_admin</b></font>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=light-dark(#FFFFFF,#EDEDED);" vertex="1" connectable="0" parent="138">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-84" y="-22" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="142" value="id &lt;=&gt; tokenable_id" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1530" y="125" width="140" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="143" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.625;entryY=0;entryDx=0;entryDy=0;endArrow=none;endFill=0;dashed=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="101" target="142">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1560" y="63" as="sourcePoint" />
|
||||
<mxPoint x="1571" y="165" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="145" value="Cookie" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1300" y="10" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="147" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="148" target="156">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1270" y="330" as="sourcePoint" />
|
||||
<mxPoint x="1130" y="80" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="148" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1350" y="1030" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="236" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="150" target="120">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="150" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="789.38" y="1030" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="152" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;startArrow=none;startFill=0;" edge="1" parent="1" source="150" target="148">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="970" as="sourcePoint" />
|
||||
<mxPoint x="1160" y="970" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="153" value="Кладем в куки <b><font style="font-size: 13px;">sanctum_token</font></b><br>для автоматической подстановки его в заголовки <br>при api запросах с фронта" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=light-dark(#FFFFFF,#EDEDED);" vertex="1" connectable="0" parent="152">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-159" y="-37" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="155" value="запрос содержит api/ &amp;&amp; <br>в куках есть sanctum_token&nbsp;" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="85" y="752.5" width="230" height="105" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="156" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1350" y="785" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="159" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="145" target="156">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1420" y="350" as="sourcePoint" />
|
||||
<mxPoint x="1380" y="660" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="160" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;jumpStyle=arc;exitX=1;exitY=0.5;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="155" target="156">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="950" y="690" as="sourcePoint" />
|
||||
<mxPoint x="1590" y="750" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="163" value="Заголовки запроса" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-70" y="10" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="164" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="165" target="163">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="80" y="340" as="sourcePoint" />
|
||||
<mxPoint x="255" y="80" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="180" value="" style="edgeStyle=none;html=1;dashed=1;endArrow=none;endFill=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="165" target="181">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="80" y="850" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="165" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-19" y="796" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="178" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="166" target="182">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="245" y="910" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="166" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="190" y="920" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="167" value="Стандартная <br>аутентификация <br>Sanctum" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="200" y="900" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="168" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="166" target="155">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="90" y="720" as="sourcePoint" />
|
||||
<mxPoint x="140" y="470" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="170" value="" style="endArrow=classic;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.25;entryDx=0;entryDy=0;jumpStyle=arc;" edge="1" parent="1" source="155" target="165">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="415" y="750" as="sourcePoint" />
|
||||
<mxPoint x="40" y="680" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="171" value="Добавляем в заголовки <br>запроса sanctum_token, <br>без него аутентификация <br>Sanctum не пройдет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="170">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-138" y="12" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="172" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="35" y="780" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="173" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="200" y="850" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="174" value="" style="endArrow=classic;html=1;edgeStyle=orthogonalEdgeStyle;entryX=0.5;entryY=0;entryDx=0;entryDy=0;jumpStyle=arc;exitX=1;exitY=0.75;exitDx=0;exitDy=0;" edge="1" parent="1" source="165" target="166">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="90" y="740" as="sourcePoint" />
|
||||
<mxPoint x="80" y="740" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="1" y="827" />
|
||||
<mxPoint x="30" y="827" />
|
||||
<mxPoint x="30" y="900" />
|
||||
<mxPoint x="200" y="900" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="181" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-20" y="1030" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="182" value="В заголовках есть <br>sanctum_token?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="100" y="1015" width="200" height="70" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="185" value="" style="edgeStyle=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="182" target="181">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="255" y="860" as="sourcePoint" />
|
||||
<mxPoint x="255" y="920" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="186" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="182" target="188">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="235" y="1040" as="sourcePoint" />
|
||||
<mxPoint x="235" y="1100" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="200" y="1120" />
|
||||
<mxPoint x="85" y="1120" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="187" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="147.5" y="1085" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="188" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1390" width="50" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="189" value="response <br>с 401 ошибкой" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="35" y="1440" width="100" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="190" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="182" target="196">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="255" y="990" as="sourcePoint" />
|
||||
<mxPoint x="300" y="1250" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="355" y="1050" />
|
||||
<mxPoint x="355" y="1130" />
|
||||
<mxPoint x="200" y="1130" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="191" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="290" y="1055" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="208" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="194" target="206">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1720" y="1290" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="1720" y="1280" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="194" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1710" y="1190.25" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="198" value="" style="edgeStyle=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="196" target="194">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1200" y="1230" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="196" value="" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="165" y="1179" width="70" height="62.5" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="199" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="196" target="188">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="255" y="990" as="sourcePoint" />
|
||||
<mxPoint x="75" y="1100" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="85" y="1210" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="200" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="135" y="1179" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="206" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1510" y="1260" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="209" value="Если токен найден, запрашиваем <br>id юзера по tokenable_id" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="1530" y="1290" width="210" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="211" value="<span style="color: rgb(0, 0, 0); text-wrap-mode: wrap;">В таблице с токенами есть</span><br style="text-wrap-mode: wrap;"><span style="color: rgb(0, 0, 0); text-wrap-mode: wrap;">запись с токеном из&nbsp;</span><span style="color: rgb(0, 0, 0); text-wrap-mode: wrap;">заголовка, <br>а также в таблице users <br>есть связанная запись <br>(пользователя) к этому токену ?</span>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="190" y="1275" width="200" height="90" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="212" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=1;" edge="1" parent="1" target="214" source="196">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="152.5" y="1110" as="sourcePoint" />
|
||||
<mxPoint x="-82.5" y="760" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="213" value="Аутентификация <br>успешна" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="212">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint y="135" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="214" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="175" y="1390" width="50" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="215" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=1;" edge="1" parent="1" target="217" source="77">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="350" y="437" as="sourcePoint" />
|
||||
<mxPoint x="22.5" y="-35" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="216" value="Редирект на страницу <br>аутентификации" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="215">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-18" y="-92" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="217" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="285" y="665" width="50" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="218" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;endFill=1;" edge="1" parent="1" source="120" target="117">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="930" y="1030" as="sourcePoint" />
|
||||
<mxPoint x="930" y="990" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="221" value="Редирект на вьюху <br>с меню Magic" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="485" y="1240" width="130" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="228" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="222" target="66">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="222" value="Запрос" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;fillColor=#e1d5e7;strokeColor=#9673a6;strokeWidth=3;" vertex="1" parent="1">
|
||||
<mxGeometry x="-215" y="-30" width="30" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="237" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="810" y="1179" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="238" value="" style="endArrow=none;dashed=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="60" target="113">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1160" y="315" as="sourcePoint" />
|
||||
<mxPoint x="1160" y="610" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="113" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="440" width="20" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="239" value="" style="endArrow=none;dashed=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="52" target="134">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1170" y="440" as="sourcePoint" />
|
||||
<mxPoint x="1170" y="620" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="28" value="В сесси есть&nbsp;<br>_auth_login" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="367.5" y="300" width="125" height="70" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="252" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="195" y="1240" width="40" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
@@ -1,701 +0,0 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram id="YrEqY51DlFa1ZGKHTR-x" name="Страница — 1">
|
||||
<mxGraphModel dx="1474" dy="1569" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="685" value="Middleware\<br>AuthetnticateMagic" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="370" y="10" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="686" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="687" target="685">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="430" y="170" as="sourcePoint"/>
|
||||
<mxPoint x="205" y="70" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="687" value="Сессия <br>стартована" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="375" y="200" width="110" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="688" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#000000;fillColor=#d5e8d4;strokeWidth=1;" edge="1" parent="1" source="687" target="818">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="510" y="280" as="sourcePoint"/>
|
||||
<mxPoint x="540" y="350" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="689" value="Да" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" vertex="1" connectable="0" parent="688">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="22" y="90" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="690" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#fff2cc;strokeColor=#000000;strokeWidth=1;" edge="1" parent="1" source="687" target="721">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="250" y="360" as="sourcePoint"/>
|
||||
<mxPoint x="320" y="350" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="691" value="Нет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" vertex="1" connectable="0" parent="690">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="17" y="-77" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="692" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0;exitY=0.5;exitDx=0;exitDy=0;strokeColor=light-dark(#000000, #446e2c);fillColor=#d5e8d4;strokeWidth=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="818" target="694">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="460" y="590" as="sourcePoint"/>
|
||||
<mxPoint x="420" y="520" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="693" value="Нет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" vertex="1" connectable="0" parent="692">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="-35" y="-27" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="694" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="347.5" y="460" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="695" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=1;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="694" target="721">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="440" y="1075" as="sourcePoint"/>
|
||||
<mxPoint x="205" y="560" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="696" value="" style="endArrow=classic;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fillColor=#fff2cc;strokeColor=#000000;strokeWidth=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;endFill=1;" edge="1" parent="1" source="818" target="822">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="665" y="580" as="sourcePoint"/>
|
||||
<mxPoint x="520" y="510" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="697" value="Да" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" vertex="1" connectable="0" parent="696">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="12" y="-55" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="698" value="Controller\<br>LoginController" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="740" y="10" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="699" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="721" target="701">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="505" y="550" as="sourcePoint"/>
|
||||
<mxPoint x="840" y="560" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="370" y="550"/>
|
||||
<mxPoint x="800" y="550"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="700" value="Проводим аутентификацию<br>&nbsp;через LDAP" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="699">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-129" y="-17" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="701" value="Аутентификация <br>LDAP успешна" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="728.75" y="560" width="142.5" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="702" value="" style="endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=light-dark(#000000, #446e2c);fillColor=#d5e8d4;strokeWidth=1;" edge="1" parent="1" source="701" target="705">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="880" y="660" as="sourcePoint"/>
|
||||
<mxPoint x="918" y="720" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="703" value="Да" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" vertex="1" connectable="0" parent="702">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="-28" y="-7" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="704" value="Session" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1100" y="10" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="705" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="789.38" y="665" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="706" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="665" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="707" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="705" target="706">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1000" y="674.5" as="sourcePoint"/>
|
||||
<mxPoint x="1170" y="674.5" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="708" value="Помещаем <b><font style="font-size: 13px;">_auth_login</font></b> и <br><b><font style="font-size: 13px;">_auth_groups</font></b>&nbsp;в сессию" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="707">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-83" y="-27" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="709" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="769" target="760">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="920" y="850" as="sourcePoint"/>
|
||||
<mxPoint x="909" y="820" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="710" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="315" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="711" value="" style="endArrow=classic;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="710" target="818">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="760" as="sourcePoint"/>
|
||||
<mxPoint x="550" y="380" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="712" value="web/api" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-240" y="95" width="80" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="713" value="Middleware\<br>AuthetnticateMagicApi" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="130" y="5" width="135" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="714" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="187.5" y="115" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="715" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="714" target="713">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="250" y="230" as="sourcePoint"/>
|
||||
<mxPoint x="240" y="100" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="716" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="712" target="714">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="110" y="120" as="sourcePoint"/>
|
||||
<mxPoint x="90" y="200" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="717" value="api ендпоинт" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="716">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-156" y="-12" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="718" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;jumpStyle=arc;" edge="1" parent="1" source="712" target="687">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="130" y="160" as="sourcePoint"/>
|
||||
<mxPoint x="420" y="190" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="719" value="web роут" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="718">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-317" y="-14" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="720" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="772" target="714">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="245" y="500" as="sourcePoint"/>
|
||||
<mxPoint x="244.5" y="220" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="721" value="views\login" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="240" y="535" width="140" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="722" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="701" target="698">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="800" y="530" as="sourcePoint"/>
|
||||
<mxPoint x="390" y="80" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="723" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="710" target="704">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="860" y="540" as="sourcePoint"/>
|
||||
<mxPoint x="860" y="80" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="1160" y="220"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="724" value="" style="endArrow=none;dashed=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="816" target="706">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1170" y="385" as="sourcePoint"/>
|
||||
<mxPoint x="1150" y="510" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="725" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.375;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;endArrow=none;endFill=0;dashed=1;" edge="1" parent="1" source="726" target="763">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1560" y="40" as="sourcePoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="726" value="users" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
|
||||
<mxGeometry x="1490" width="60" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="727" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="729" target="726">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1260" y="600" as="sourcePoint"/>
|
||||
<mxPoint x="1100" y="80" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="728" value="" style="edgeStyle=none;html=1;dashed=1;endArrow=none;endFill=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="729" target="805">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1537.2727272727275" y="930" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="729" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1510" y="745" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="730" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="790" y="745" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="731" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="730" target="705">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="930" y="850" as="sourcePoint"/>
|
||||
<mxPoint x="930" y="660" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="732" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;" edge="1" parent="1" source="730" target="729">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="640" as="sourcePoint"/>
|
||||
<mxPoint x="1160" y="640" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="733" value="Создаем запись с логином пользователя в модели users, <br>если аутентификация проходит впервые<br>(нужно для работы Sanctum)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=light-dark(#FFFFFF,#EDEDED);" vertex="1" connectable="0" parent="732">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-235" y="-27" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="734" value="personal_access_tokens" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
|
||||
<mxGeometry x="1640" y="5" width="160" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="735" value="модель с токенами <br>доступа Sanctum" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="1655" y="-40" width="130" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="736" value="" style="edgeStyle=none;html=1;endArrow=none;endFill=0;" edge="1" parent="1" source="737" target="760">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="737" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="790.62" y="830" width="20" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="738" value="" style="endArrow=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="730" target="737">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="930" y="970" as="sourcePoint"/>
|
||||
<mxPoint x="1020" y="890" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="739" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="741" target="734">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1320" y="730" as="sourcePoint"/>
|
||||
<mxPoint x="1320" y="80" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="740" value="" style="edgeStyle=none;html=1;endArrow=none;endFill=0;dashed=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="741" target="800">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1720" y="930" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="741" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1710" y="830" width="20" height="65" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="742" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;exitX=1;exitY=0.25;exitDx=0;exitDy=0;jumpStyle=arc;" edge="1" parent="1" source="737" target="741">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="750" as="sourcePoint"/>
|
||||
<mxPoint x="1380" y="750" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="743" value="Создаем запись с токеном доступа Sanctum.<br>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="742">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-369" y="-19" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="744" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;jumpStyle=arc;" edge="1" parent="1" source="694" target="816">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="440" y="1040" as="sourcePoint"/>
|
||||
<mxPoint x="1122" y="920" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="745" value="Кладем в сессию параметр _<b><font style="font-size: 13px;">auth_prev_page</font></b> со значением URL, <br>на который&nbsp;<span style="color: rgb(0, 0, 0);">перекинем пользователя&nbsp;</span>после аутентификации&nbsp;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="744">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-259" y="-22" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="746" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="747" target="758">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="717" y="1320" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="747" value="views\menu" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="600" y="1247" width="120" height="34.5" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="748" value="адрес страницы <br>есть?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="728.13" y="1115" width="142.5" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="749" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="1130" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="750" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="759" target="749">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1170" y="900" as="sourcePoint"/>
|
||||
<mxPoint x="1170" y="660" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="751" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;startArrow=classic;startFill=1;" edge="1" parent="1" source="748" target="749">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="750" as="sourcePoint"/>
|
||||
<mxPoint x="1380" y="750" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="752" value="Запрашиваем url страницы <br>откуда пришел пользователь<br><b><font style="font-size: 13px;">auth_prev_page</font></b>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;textShadow=0;" vertex="1" connectable="0" parent="751">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-49" y="-37" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="753" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="688.75" y="1115" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="754" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="756" target="748">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="918.62" y="1238" as="sourcePoint"/>
|
||||
<mxPoint x="921" y="1190" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="755" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="756" target="758">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="801" y="1360"/>
|
||||
<mxPoint x="725" y="1360"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="756" value="views\{url}" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="740" y="1246.5" width="121.25" height="33.5" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="757" value="Редирект на url откуда <br>пришел пользователь" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="860" y="1243.25" width="150" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="758" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="700" y="1435" width="50" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="759" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="940" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="760" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="790" y="940" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="761" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;startArrow=none;startFill=0;" edge="1" parent="1" source="760" target="759">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1051" y="1094" as="sourcePoint"/>
|
||||
<mxPoint x="1160" y="1094" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="762" value="Кладем в сессию <br>параметр <font style="font-size: 13px;"><b>is_admin</b></font>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=light-dark(#FFFFFF,#EDEDED);" vertex="1" connectable="0" parent="761">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-84" y="-22" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="763" value="id &lt;=&gt; tokenable_id" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1530" y="125" width="140" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="764" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.625;entryY=0;entryDx=0;entryDy=0;endArrow=none;endFill=0;dashed=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="734" target="763">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1560" y="63" as="sourcePoint"/>
|
||||
<mxPoint x="1571" y="165" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="765" value="Cookie" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1300" y="10" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="766" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="767" target="773">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1270" y="330" as="sourcePoint"/>
|
||||
<mxPoint x="1130" y="80" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="767" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1350" y="1030" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="768" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="769" target="748">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="769" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="789.38" y="1030" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="770" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;jumpStyle=arc;startArrow=none;startFill=0;" edge="1" parent="1" source="769" target="767">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="990" y="970" as="sourcePoint"/>
|
||||
<mxPoint x="1160" y="970" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="771" value="Кладем в куки <b><font style="font-size: 13px;">sanctum_token</font></b><br>для автоматической подстановки его в заголовки <br>при api запросах с фронта" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=light-dark(#FFFFFF,#EDEDED);" vertex="1" connectable="0" parent="770">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-159" y="-37" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="772" value="URL запроса содержит api/ &amp;&amp; <br>в куках есть sanctum_token&nbsp;" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="85" y="752.5" width="230" height="105" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="773" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1350" y="785" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="774" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="765" target="773">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1420" y="350" as="sourcePoint"/>
|
||||
<mxPoint x="1380" y="660" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="775" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;jumpStyle=arc;exitX=1;exitY=0.5;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="772" target="773">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="950" y="690" as="sourcePoint"/>
|
||||
<mxPoint x="1590" y="750" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="776" value="Заголовки запроса" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-70" y="10" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="777" value="" style="endArrow=none;dashed=1;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="779" target="776">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="80" y="340" as="sourcePoint"/>
|
||||
<mxPoint x="255" y="80" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="778" value="" style="edgeStyle=none;html=1;dashed=1;endArrow=none;endFill=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="779" target="789">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="80" y="850" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="779" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-19" y="796" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="780" value="" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="781" target="790">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="245" y="910" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="781" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="190" y="890" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="782" value="Стандартная <br>аутентификация <br>Sanctum" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="207.5" y="870" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="783" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="781" target="772">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="90" y="720" as="sourcePoint"/>
|
||||
<mxPoint x="140" y="470" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="784" value="" style="endArrow=classic;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.25;entryDx=0;entryDy=0;jumpStyle=arc;" edge="1" parent="1" source="772" target="779">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="415" y="750" as="sourcePoint"/>
|
||||
<mxPoint x="40" y="680" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="785" value="Добавляем в заголовки <br>запроса sanctum_token, <br>без него аутентификация <br>Sanctum не пройдет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="784">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-138" y="12" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="786" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="35" y="780" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="787" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="200" y="850" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="788" value="" style="endArrow=classic;html=1;edgeStyle=orthogonalEdgeStyle;entryX=0.5;entryY=0;entryDx=0;entryDy=0;jumpStyle=arc;exitX=1;exitY=0.75;exitDx=0;exitDy=0;" edge="1" parent="1" source="779" target="781">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="90" y="740" as="sourcePoint"/>
|
||||
<mxPoint x="80" y="740" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="1" y="827"/>
|
||||
<mxPoint x="30" y="827"/>
|
||||
<mxPoint x="30" y="870"/>
|
||||
<mxPoint x="200" y="870"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="789" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="-19" y="975" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="790" value="В заголовках есть <br>Authorization токен sanctum?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="100" y="960" width="200" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="791" value="" style="edgeStyle=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="790" target="789">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="255" y="860" as="sourcePoint"/>
|
||||
<mxPoint x="255" y="920" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="792" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="790" target="794">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="235" y="1040" as="sourcePoint"/>
|
||||
<mxPoint x="235" y="1100" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="200" y="1050"/>
|
||||
<mxPoint x="85" y="1050"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="793" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="130" y="1025" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="794" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1440" width="50" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="795" value="response <br>с 401 ошибкой" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="30" y="1490" width="100" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="796" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="790" target="802">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="255" y="990" as="sourcePoint"/>
|
||||
<mxPoint x="300" y="1250" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="355" y="995"/>
|
||||
<mxPoint x="355" y="1060"/>
|
||||
<mxPoint x="200" y="1060"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="797" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="300" y="970" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="798" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="800" target="805">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1720" y="1290" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="1760" y="1210"/>
|
||||
<mxPoint x="1760" y="1280"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="799" value="" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;dashed=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="800" target="827">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1721" y="1400" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="800" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1710" y="1190.25" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="801" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;startArrow=classic;startFill=1;" edge="1" parent="1" source="802" target="800">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1200" y="1230" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="510" y="1114"/>
|
||||
<mxPoint x="510" y="1210"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="802" value="" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="165" y="1082.5" width="70" height="62.5" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="803" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="802" target="794">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="255" y="990" as="sourcePoint"/>
|
||||
<mxPoint x="75" y="1100" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="85" y="1114"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="804" value="Нет" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="130" y="1082.5" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="805" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1510" y="1260" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="806" value="Если токен найден, запрашиваем <br>id юзера по tokenable_id" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="1530" y="1243.25" width="210" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="807" value="<span style="color: rgb(0, 0, 0); text-wrap-mode: wrap;">В таблице с токенами есть</span><br style="text-wrap-mode: wrap;"><span style="color: rgb(0, 0, 0); text-wrap-mode: wrap;">запись с токеном из&nbsp;</span><span style="color: rgb(0, 0, 0); text-wrap-mode: wrap;">заголовка, <br>а также в таблице users <br>есть связанная запись <br>(пользователя) к этому токену ?</span>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="210" y="1130" width="200" height="90" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="808" value="" style="endArrow=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=0;" edge="1" parent="1" source="802" target="829">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="152.5" y="1110" as="sourcePoint"/>
|
||||
<mxPoint x="-82.5" y="760" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="809" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="175" y="1440" width="50" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="810" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;endFill=1;" edge="1" parent="1" source="748" target="747">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="930" y="1030" as="sourcePoint"/>
|
||||
<mxPoint x="930" y="990" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="811" value="Редирект на вьюху <br>с меню Magic" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="485" y="1240" width="130" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="812" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="813" target="712">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="813" value="Запрос" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;fillColor=#e1d5e7;strokeColor=#9673a6;strokeWidth=3;" vertex="1" parent="1">
|
||||
<mxGeometry x="-215" y="-30" width="30" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="814" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="810" y="1179" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="815" value="" style="endArrow=none;dashed=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="710" target="816">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1160" y="315" as="sourcePoint"/>
|
||||
<mxPoint x="1160" y="610" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="816" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1150" y="460" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="817" value="" style="endArrow=none;dashed=1;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="706" target="759">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="1170" y="440" as="sourcePoint"/>
|
||||
<mxPoint x="1170" y="620" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="818" value="В сесси есть&nbsp;<br>_auth_login" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="367.5" y="300" width="125" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="819" value="Да" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="150" y="1140" width="40" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="820" value="" style="endArrow=classicThin;html=1;edgeStyle=orthogonalEdgeStyle;fillColor=#fff2cc;strokeColor=light-dark(#000000, #6d5100);strokeWidth=1;endFill=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="701" target="721">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="710" y="690" as="sourcePoint"/>
|
||||
<mxPoint x="370" y="610" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="729" y="630"/>
|
||||
<mxPoint x="310" y="630"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="821" value="Нет" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=13;" vertex="1" connectable="0" parent="820">
|
||||
<mxGeometry x="-0.3625" y="8" relative="1" as="geometry">
|
||||
<mxPoint x="104" y="-28" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="822" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="405" y="390" width="50" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="823" value="Посредник пропускает <br>запрос дальше" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="450" y="390" width="150" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="824" value="Аутентификация <br>успешна" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="1">
|
||||
<mxGeometry x="725" y="1505" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="825" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.75;entryDx=0;entryDy=0;exitX=0.969;exitY=0.671;exitDx=0;exitDy=0;jumpStyle=arc;exitPerimeter=0;" edge="1" parent="1" source="737" target="741">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="820.6199999999999" y="857.5" as="sourcePoint"/>
|
||||
<mxPoint x="1720" y="860" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="826" value="Записываем в поле abilities <br>permsissions пользователя для авторизации" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="825">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-368" y="15" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="827" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="1710" y="1359.25" width="20" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="828" value="" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="829" target="827">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="1670" y="1390" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="829" value="" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="170" y="1350" width="60" height="58.5" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="830" value="" style="endArrow=classic;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="829" target="809">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="210" y="1155" as="sourcePoint"/>
|
||||
<mxPoint x="200" y="1450" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="831" value="Аутентификация <br>успешна" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="830">
|
||||
<mxGeometry x="0.1298" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="2" y="92" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="832" value="Проверяем срок жизни <br>sanctum токена.<br>Если остается менее часа,<br>продлеваем на 2 часа<br>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
||||
<mxGeometry x="210" y="1310" width="170" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
+6
-41
@@ -1,55 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Contracts\Http\Kernel;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Check If The Application Is Under Maintenance
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If the application is in maintenance / demo mode via the "down" command
|
||||
| we will load this file so that any pre-rendered content can be shown
|
||||
| instead of starting the framework, which could cause an exception.
|
||||
|
|
||||
*/
|
||||
|
||||
// Determine if the application is in maintenance mode...
|
||||
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
||||
require $maintenance;
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader for
|
||||
| this application. We just need to utilize it! We'll simply require it
|
||||
| into the script here so we don't need to manually load our classes.
|
||||
|
|
||||
*/
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once we have the application, we can handle the incoming request using
|
||||
| the application's HTTP kernel. Then, we will send the response back
|
||||
| to this client's browser, allowing them to enjoy our application.
|
||||
|
|
||||
*/
|
||||
|
||||
// Bootstrap Laravel and handle the request...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$kernel = $app->make(Kernel::class);
|
||||
|
||||
$response = $kernel->handle(
|
||||
$request = Request::capture()
|
||||
)->send();
|
||||
|
||||
$kernel->terminate($request, $response);
|
||||
$app->handleRequest(Request::capture());
|
||||
|
||||
-48249
File diff suppressed because it is too large
Load Diff
Vendored
-30
@@ -1,34 +1,4 @@
|
||||
import 'bootstrap';
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
window.axios = axios;
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// import Pusher from 'pusher-js';
|
||||
// window.Pusher = Pusher;
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||
// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
|
||||
// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
|
||||
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
|
||||
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
|
||||
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
|
||||
// enabledTransports: ['ws', 'wss'],
|
||||
// });
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Laravel + React</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://intranet.rencredit.ru/Departments/CS/technical_library/css/normalize-SP.css?v={{ rand(111111, 999999); }}" type="text/css">
|
||||
<link rel="stylesheet" href="https://intranet.rencredit.ru/Departments/CS/technical_library/css/choices.min.css?v={{ rand(111111, 999999); }}" type="text/css">
|
||||
<link rel="stylesheet" href="https://intranet.rencredit.ru/Departments/CS/technical_library/css/style.css?v={{ rand(111111, 999999); }}" type="text/css">
|
||||
<link rel="stylesheet" href="https://intranet.rencredit.ru/Departments/CS/components/css/style.css?v={{ rand(111111, 999999); }}" type="text/css">
|
||||
<link rel="stylesheet" href="./../css/general.css?v={{ rand(111111, 999999); }}" type="text/css">
|
||||
<!-- Без команды ниже корректно не обрабатывается React скрипт -->
|
||||
@viteReactRefresh
|
||||
<!-- Общие React компоненты для всех страниц -->
|
||||
@vite(['resources/js/main_script.tsx'])
|
||||
<!-- Общие React компоненты для всех страниц -->
|
||||
@vite(['resources/css/main_styles.css'])
|
||||
@yield('app_styles')
|
||||
</head>
|
||||
<body>
|
||||
<div id=page__header-block data-app_name="{{ $moduleName->getRuModuleName() }}"></div>
|
||||
<div id=page__content-block>
|
||||
@yield('app_content')
|
||||
</div>
|
||||
@yield('app_scripts')
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +1,4 @@
|
||||
*
|
||||
!private/
|
||||
!public/
|
||||
!.gitignore
|
||||
|
||||
+13
-24
@@ -1,29 +1,18 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
import react from '@vitejs/plugin-react'; // Подключите плагин React
|
||||
import { globbySync } from 'globby'; //Пакет для универсального указания файлов разлиных модулей
|
||||
|
||||
// Ищем все JS/CS точки входа во всех модулях
|
||||
const moduleEntries = globbySync([
|
||||
'Modules/*/resources/js/app.{jsx,tsx}', // Все app.jsx и app.tsx в подпапках Modules
|
||||
'Modules/*/resources/css/app.css', // Все app.css
|
||||
]);
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
laravel({
|
||||
// Укажите входные точки
|
||||
input: [
|
||||
'resources/css/app.css',
|
||||
'resources/js/app.tsx',
|
||||
//Благодаря переменной ниже, мы можем не указывать каждый входной jsx и css скрипты для каждого модуля
|
||||
...moduleEntries,
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
react(), // Подключаем плагин React
|
||||
],
|
||||
esbuild: {
|
||||
loader: 'tsx', // Важно для обработки TypeScript
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
input: ['resources/css/app.css', 'resources/js/app.js'],
|
||||
refresh: true,
|
||||
}),
|
||||
tailwindcss(),
|
||||
],
|
||||
server: {
|
||||
watch: {
|
||||
ignored: ['**/storage/framework/views/**'],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user