Compare commits

..

15 Commits

Author SHA1 Message Date
vasya 2e555cea9f кажется, тестировался функционал доступов, решил оставить, но не использовал (вроде бы) в своей тестовой версии 2026-04-11 21:45:26 +03:00
vasya 554a416bf4 первая реализация компонента прелоадера, вроде бы, отказался от реализации через хук и переписал, как и всплывающие окна, через контекст 2026-04-11 21:33:45 +03:00
vasya da6d13eab3 первая реализация компонента всплывающих окон. Потом я отказался от хука и реализовал через контекст вроде бы. оставляю на случай если увидите упоминание по коду этого скрипта, но самого его не найдете и будете думать - ну что за мудак, не закоммитил скрипт 2026-04-11 21:10:46 +03:00
vasya 4bacf61bf8 скорее всего этот шаблон использовался когда мы тестировали Inertia JS. Теперь он не нужен 2026-04-11 21:04:01 +03:00
vasya 3cf31a5d42 см initial commit 2026-04-11 21:00:51 +03:00
vasya ebdcd9485b см initial commit 2026-04-11 19:44:06 +03:00
vasya 2c5dbfc4d1 добавляю тестовые скрипты на всякий случай 2026-04-11 19:38:43 +03:00
vasya 77bd5c2581 добавляю тестовый модуль. Не уверен, что он нужен, но на всякий случай пусть будет, если там что-то тестировалось нужное или интересное 2026-04-11 19:33:53 +03:00
vasya 21eb65ad4b см initial commit 2026-03-29 20:27:21 +03:00
vasya 31e725b29f см initial commit 2026-03-29 20:10:34 +03:00
vasya 1de437cc3c см initial commit 2026-03-29 19:11:01 +03:00
vasya e0796354e6 см initial commit 2026-03-22 20:29:26 +03:00
vasya bad1c3bedb см initial commit 2026-03-22 20:22:31 +03:00
vasya 3db92a5ad6 см initial commit 2026-03-22 20:20:27 +03:00
vasya 47d47a9cf1 INITIAL COMMIT - вероятно, мусорные скрипты, которые с вероятностью 90% не участвуют в работе приложения, но для истории я их оставляю 2026-03-22 19:45:03 +03:00
50 changed files with 897 additions and 444 deletions
+1 -1
View File
@@ -14,5 +14,5 @@ trim_trailing_whitespace = false
[*.{yml,yaml}] [*.{yml,yaml}]
indent_size = 2 indent_size = 2
[compose.yaml] [docker-compose.yml]
indent_size = 4 indent_size = 4
@@ -0,0 +1,67 @@
<?php
namespace Modules\Test\App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class TestController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('test::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('test::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('test::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('test::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}
View File
@@ -0,0 +1,59 @@
<?php
namespace Modules\Test\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\Test\App\Http\Controllers';
/**
* 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('Test', '/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('Test', '/routes/api.php'));
}
}
@@ -0,0 +1,114 @@
<?php
namespace Modules\Test\App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class TestServiceProvider extends ServiceProvider
{
protected string $moduleName = 'Test';
protected string $moduleNameLower = 'test';
/**
* 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,16 @@
<?php
namespace Modules\Test\Database\Seeders;
use Illuminate\Database\Seeder;
class TestDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}
+31
View File
@@ -0,0 +1,31 @@
{
"name": "nwidart/test",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\Test\\": "",
"Modules\\Test\\App\\": "app/",
"Modules\\Test\\Database\\Factories\\": "database/factories/",
"Modules\\Test\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\Test\\Tests\\": "tests/"
}
}
}
View File
+5
View File
@@ -0,0 +1,5 @@
<?php
return [
'name' => 'Test',
];
+11
View File
@@ -0,0 +1,11 @@
{
"name": "Test",
"alias": "test",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\Test\\App\\Providers\\TestServiceProvider"
],
"files": []
}
+15
View File
@@ -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,7 @@
@extends('test::layouts.master')
@section('content')
<h1>Hello World</h1>
<p>Module: {!! config('test.name') !!}</p>
@endsection
@@ -0,0 +1,29 @@
<!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>Test 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-test', 'resources/assets/sass/app.scss') }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-test', 'resources/assets/js/app.js') }} --}}
</body>
View File
+19
View File
@@ -0,0 +1,19 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| 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('test', fn (Request $request) => $request->user())->name('test');
});
+19
View File
@@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Test\App\Http\Controllers\TestController;
/*
|--------------------------------------------------------------------------
| 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([], function () {
Route::resource('test', TestController::class)->names('test');
});
+26
View File
@@ -0,0 +1,26 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
build: {
outDir: '../../public/build-test',
emptyOutDir: true,
manifest: true,
},
plugins: [
laravel({
publicDirectory: '../../public',
buildDirectory: 'build-test',
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',
//];
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\TestData;
class testDataCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'data_base:test-data-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Тестовая команда';
/**
* Execute the console command.
*/
public function handle()
{
$testDataModel = new TestData;
$test = TestData::where('test_char', 'hellos')->get();
var_dump($test);
}
}
-30
View File
@@ -1,30 +0,0 @@
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*/
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
}
}
@@ -0,0 +1,36 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\AccessModel;
class AccessListController extends Controller
{
public function getAccess($id = null)
{
$accessListModel = new AccessModel();
$accessListData = $accessListModel::where(['access_id' => $id])->select('access_id')->get();
if ($id) {
echo '<pre>'; var_dump($accessListData->toArray()); echo'</pre>';
} else {
var_dump($accessListModel::all());
}
}
public function postAccess(Request $rqst)
{
$accessListModel = new AccessModel();
$accessListModel->role = $rqst['role'];
$accessListModel->title = $rqst['title'];
$accessListModel->save();
}
public function delAccess($id)
{
$accessListModel = new AccessModel();
//$accessListModel::where(['access_id' => $id])->delete();
$accessListModel::destroy($id);
}
}
+53
View File
@@ -0,0 +1,53 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
class TestController extends Controller
{
public function getRoles()
{
$roles = DB::connection('mysql')->table('arch_lk_access_list')->select(['*'])->get();
return view('roles', ['roles' => $roles]);
}
public function getAccess($id)
{
$roles = DB::connection('mysql')->table('arch_lk_access_list')->select(['*'])->where('access_id', '=', $id)->get();
$response = new Response(json_encode($roles[0]));
$response->header('Content-type', 'text/plain');
$response->header('Access-Control-Allow-Methods', 'POST');
return $response;
}
public function redirect()
{
// return redirect()->away('https://google.com');
//return redirect()->action([TestController::class, 'getAccess'], ['id' => 3]);
return redirect()->route('getAccessById', ['id' => 2]);
}
public function getParam(Request $rqst)
{
//echo '<pre>'; var_dump($rqst->cookie('test_cookie')); echo'</pre>';
//return response('test')->cookie('test_cookie', $rqst->id);
}
public function setRole(Request $rqst)
{
$lastInsert = DB::connection('mysql')->table('arch_lk_access_list')->insertGetId(['role' => $rqst->roleName, 'title' => $rqst->roleTitle]);
return redirect()->route('get_role');
}
public function delRole(Request $rqst)
{
$lastInsert = DB::connection('mysql')->table('arch_lk_access_list')->where('access_id', '=', $rqst->access_id)->delete();
return redirect()->route('get_role');
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\TestData;
class TestDataController extends Controller
{
public function insertNewData(Request $rqst)
{
$model = new TestData;
$model->test_int = $rqst->int;
$model->test_char = $rqst->char;
$model->save();
}
}
@@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers;
use App\Models\TestFormModel;
use Illuminate\Http\Request;
class TestFormController extends Controller
{
public function getForm()
{
return view('test_form');
}
public function setForm(Request $rqst)
{
$testTable = new TestFormModel;
$testTable->first_name = $rqst->first_name;
$testTable->last_name = $rqst->last_name;
$testTable->department_name = $rqst->department_name;
$testTable->save();
return redirect('/test_table');
}
}
+17
View File
@@ -0,0 +1,17 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AccessModel extends Model
{
use HasFactory;
protected $connection = 'mysql';
protected $table = 'tm_lk_access_list';
public $timestamps = false;
protected $primaryKey = 'access_id';
}
+13
View File
@@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TestData extends Model
{
use HasFactory;
protected $table = 'test_data';
protected $connection = 'mysql';
}
+13
View File
@@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TestFormModel extends Model
{
use HasFactory;
protected $connection = 'mysql';
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
/**
* Провайдер для регистрации сервиса аутентификации
*/
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
//
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
//
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*/
public function boot(): void
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*/
public function shouldDiscoverEvents(): bool
{
return false;
}
}
-40
View File
@@ -1,40 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to your application's "home" route.
*
* Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/home';
/**
* Define your route model bindings, pattern filters, and other route configuration.
*/
public function boot(): void
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
$this->routes(function () {
Route::middleware('api')
->prefix('api')
->group(base_path('routes/api.php'));
Route::middleware('web')
->group(base_path('routes/web.php'));
});
}
}
-71
View File
@@ -1,71 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];
-34
View File
@@ -1,34 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];
+6 -9
View File
@@ -2,24 +2,21 @@
namespace Database\Seeders; namespace Database\Seeders;
use App\Models\User; // use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder class DatabaseSeeder extends Seeder
{ {
use WithoutModelEvents;
/** /**
* Seed the application's database. * Seed the application's database.
*/ */
public function run(): void public function run(): void
{ {
// User::factory(10)->create(); // \App\Models\User::factory(10)->create();
User::factory()->create([ // \App\Models\User::factory()->create([
'name' => 'Test User', // 'name' => 'Test User',
'email' => 'test@example.com', // 'email' => 'test@example.com',
]); // ]);
} }
} }
-20
View File
@@ -1,20 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
'failed' => 'These credentials do not match our records.',
'password' => 'The provided password is incorrect.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
];
-19
View File
@@ -1,19 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'previous' => '&laquo; Previous',
'next' => 'Next &raquo;',
];
-22
View File
@@ -1,22 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Password Reset Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/
'reset' => 'Your password has been reset.',
'sent' => 'We have emailed your password reset link.',
'throttled' => 'Please wait before retrying.',
'token' => 'This password reset token is invalid.',
'user' => "We can't find a user with that email address.",
];
-191
View File
@@ -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' => 'The :attribute field must be accepted.',
'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' => 'The :attribute field must match the format :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' => 'The selected :attribute is invalid.',
'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' => 'The :attribute field must not be greater than :max characters.',
],
'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' => 'The :attribute field is prohibited.',
'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' => 'The :attribute field format is invalid.',
'required' => 'The :attribute field is required.',
'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' => [],
];
+4 -7
View File
@@ -19,17 +19,14 @@
</source> </source>
<php> <php>
<env name="APP_ENV" value="testing"/> <env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/> <env name="BCRYPT_ROUNDS" value="4"/>
<env name="BROADCAST_CONNECTION" value="null"/> <env name="CACHE_DRIVER" value="array"/>
<env name="CACHE_STORE" value="array"/> <!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<env name="DB_CONNECTION" value="sqlite"/> <!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_MAILER" value="array"/> <env name="MAIL_MAILER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/> <env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/> <env name="SESSION_DRIVER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="TELESCOPE_ENABLED" value="false"/> <env name="TELESCOPE_ENABLED" value="false"/>
<env name="NIGHTWATCH_ENABLED" value="false"/>
</php> </php>
</phpunit> </phpunit>
@@ -0,0 +1,32 @@
import { useState } from 'react';
import { MagicPopupType } from '../../components/MagicPopupContainer';
export const MagicPopupHook = () => {
// //Стейт с набором попапов для отрисовки
// const [popupArr, setPopupArr] = useState<MagicPopupType[] | []>( [] );
// //ИСПОЛЬЗОВАНИЕ USECALLBACK? я не использую его для функций удаления и добавления новых попапов в этом хуке, что должно приводить к созданию новых экземпляров функций каждый вызов хука (удаление, добавления попапа). Функция добавления попапа является пропсом для TaxiForm, значит, содание нового экземпляра функции добавления попапа в хуке должно вызывать перерендер TaxiForm? Но я его не замечаю (нет мигания в дом дереве элемента где рендерится TaxiForm ни при создании, не при удалении попапа)
// //Колбэк для добавление нового попапа. Его нужно передавать в каждый компонент, где планируется вызывать попапы. В аргументы этого колбэка передаются объекты с информацией для каждого попапа (текст, таймер и т.д.)
// function addPopup (newPopupArrData: MagicPopupType[]) {
// setPopupArr(prev => {
// //Конкатенируем предыдущее состояние набора попапов и новые попапы, присваивая новому попапу параметр id с уникальным рандомным значением
// return [...prev, ...newPopupArrData].map(popup => popup.id ? popup : {...popup, id: getRandomId()})
// });
// };
// //Колбэк для удаления попапа из набора
// function delPopup (popupDelKey: number) {
// setPopupArr(prev => {
// return prev.filter(popup => popup.id !== popupDelKey);
// });
// };
// //Функция генерации случайного числа для формирования на его основе уникального идентификатора для каждого компонента попаппа
// function getRandomId(): number { return Date.now() - Math.random() };
// return {
// popupArr,
// addPopup,
// delPopup,
// }
}
@@ -0,0 +1,26 @@
import React, { useState } from "react";
import Preloader from "../../components/preloader/Preloader";
//Хук для формирования пропсов управления состояний прелоадера, экспортируемых в компоненты страницы, где планируется вызывать прелоадер
export const MagicPreloaderHook = () => {
//Стейт для видимости прелоадера
const [preloaderVisibleState, setPreloaderVisibleState] = useState<boolean>(true);
//Стейт для текста прелоадера
const [preloaderTextState, setPreloaderTextState] = useState<string>('загрузка');
//Сеттер для смены состояний прелоадера
function setPreloaderParams (visibleState: boolean, textState?: string)
{
setPreloaderVisibleState(visibleState)
textState ? setPreloaderTextState(textState) : true, []
};
return {
setPreloaderParams,
PreloaderComponent: ( {preloaderVisible = preloaderVisibleState, preloaderText = preloaderTextState} ) => (
<Preloader
visible={preloaderVisible}
text={preloaderText}
/>
)
}
}
+22
View File
@@ -0,0 +1,22 @@
<html>
<head>
@vite(['resources/js/app.js', 'resources/css/app.css'])
<title>Страница с ролями</title>
</head>
<body>
<p>{{ $roleData }}</p>
<!-- <div id='root'></div>
<div id='counter'></div> -->
<script type="module">
//import Example from './Example.js';
// Передаем данные напрямую в компонент
const props = {!! $roleData !!};
console.log(props)
console.log('da')
//ReactDOM.render(<App {...props} />, document.getElementById('root'));
</script>
</body>
</html>
+16
View File
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Laravel + React + Inertia</title>
@viteReactRefresh <!-- без это директивы возникает ошибка "React refresh preamble was not loaded. Something is wrong" Эта директива подключает скрипт горячей перезагрузки, но вообще этот скрипт должен подключаться при использовании плагина @vitejs/plugin-react -->
@vite(['resources/js/app.jsx']) <!-- Подключение Inertia и React -->
<!-- Гаврилов. нам не нужна больше inertia. Убрать? -->
@inertiaHead <!-- попробовать убрать, получится ли тянуть css стили без явного указания -->
</head>
<body>
<!-- Гаврилов. нам не нужна больше inertia. Убрать? -->
@inertia
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
<html>
<head>
<title>Страница с ролями</title>
</head>
<body>
<table style=border:1px solid black>
<tr>
<th>id роли</th>
<th>имя роли</th>
<th>заголовок роли</th>
<th>удалить</th>
</tr>
@foreach($roles as $role)
<tr>
<td>{{ $role->access_id }}</td>
<td>{{ $role->role }}</td>
<td>{{ $role->title }}</td>
<td>
<form method="POST" action="{{ url('role_del') }}">
@csrf
<input type="hidden" name="access_id" value="{{ $role->access_id }}">
<button type='submit'>Удалить</button>
</form>
</td>
</tr>
@endforeach
</table>
<form method="POST" action="{{ url('role') }}">
@csrf
<label for="input-email">Имя</label>
<input type="text" id="input-name" name="roleName" placeholder="Введите имя роли">
<label for="input-email">Заголовок</label>
<input type="text" id="input-title" name="roleTitle" placeholder="Введите заголовок роли">
<button type="submit">Отправить</button>
</form>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
<html>
<head>
<title>Страница с ролями</title>
</head>
<body>
<form method="POST" action="{{ url('test_table') }}">
@csrf
<label for="first_name">Имя</label>
<input type="text" id="first_name" name="first_name" placeholder="Введите имя">
<label for="last_name">Фамилия</label>
<input type="text" id="last_name" name="last_name" placeholder="Введите фамилию">
<label for="department">Отдел</label>
<input type="text" id="department_name" name="department_name" placeholder="Введите отдел">
<button type="submit">Отправить</button>
</form>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
<?php
use Illuminate\Support\Facades\Broadcast;
/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
*/
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});