perf: 🚨 update phpcs config with pint

This commit is contained in:
Alexis Gousseau 2026-06-05 17:05:46 +02:00
parent 9f6833aa81
commit 13c49e47e7
No known key found for this signature in database
GPG key ID: 7F3C786EE12DBB72
120 changed files with 1254 additions and 1515 deletions

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use App\Models\User;
@ -34,12 +36,10 @@ class MakeUser extends Command
/**
* Execute the console command.
*
* @return void
*/
public function handle(): void
{
$this->components->info("Creating a new <comment>Support user</comment>...");
$this->components->info('Creating a new <comment>Support user</comment>...');
$firstName = $this->askValid(
'first_name',
@ -82,23 +82,21 @@ class MakeUser extends Command
/**
* Ask for a value and validate it, re-prompting on failure.
*
* @param string $field
* @param string $label
* @param string $default
* @param array<int, string> $rules
* @return string
* @param array<int, string> $rules
*/
private function askValid(string $field, string $label, string $default, array $rules): string
{
try {
$value = $this->ask(sprintf("Type the wanted user %s", $label), $default);
$value = $this->ask(sprintf('Type the wanted user %s', $label), $default);
$validator = Validator::make([$field => $value], [$field => $rules]);
$validator->validate();
return $value;
} catch (ValidationException $e) {
$this->components->error(
collect($e->errors())->flatten()->first()
);
return $this->askValid($field, $label, $default, $rules);
}
}
@ -114,7 +112,7 @@ class MakeUser extends Command
$defaultRole = UserRoleRegistry::get('client');
$options = collect($roles)->mapWithKeys(
fn(object $role) => [Str::ucFirst($role->label) => $role]
fn (object $role) => [Str::ucFirst($role->label) => $role]
);
$choice = $this->choice(
@ -123,13 +121,12 @@ class MakeUser extends Command
Str::ucFirst($defaultRole->label),
);
$choiceKey = is_string($choice) ? $choice : (string) $choice[0];
return $options->get($choiceKey) ?? $defaultRole;
}
/**
* Ask for a password and confirmation password.
*
* @return string
*/
private function askPassword(): string
{
@ -151,9 +148,11 @@ class MakeUser extends Command
],
]
)->validate();
return $password;
} catch (ValidationException $e) {
$this->components->error(collect($e->errors())->flatten()->first());
return $this->askPassword();
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Enums;
use Uwil\LaravelCommon\Traits\Enums\BaseEnum;
@ -36,8 +38,6 @@ enum NoticeTypeEnum: int
/**
* Get Class.
*
* @return string
*/
public function class(): string
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Auth;
use App\Http\Requests\Auth\ForgotPasswordRequest;
@ -9,6 +11,7 @@ use App\Mails\Auth\ResetPassword;
use App\Models\User;
use App\Models\UserPassword;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;
@ -18,6 +21,7 @@ use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Str;
use Inertia\Inertia;
use Inertia\Response;
/**
* Manages backend authentication sessions (login/logout).
@ -26,21 +30,16 @@ class AuthenticatedSessionController extends Controller
{
/**
* Display the login view.
*
* @return \Inertia\Response
*/
public function login(): \Inertia\Response
public function login(): Response
{
return Inertia::render('back/Pages/Auth/Login');
}
/**
* Handle an incoming authentication request.
*
* @param \App\Http\Requests\Auth\LoginRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function postLogin(LoginRequest $request): \Illuminate\Http\RedirectResponse
public function postLogin(LoginRequest $request): RedirectResponse
{
$request->authenticate();
$request->session()->regenerate();
@ -50,11 +49,8 @@ class AuthenticatedSessionController extends Controller
/**
* Destroy an authenticated session.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function logout(Request $request): \Illuminate\Http\RedirectResponse
public function logout(Request $request): RedirectResponse
{
Auth::guard('backend')->logout();
@ -66,21 +62,16 @@ class AuthenticatedSessionController extends Controller
/**
* Display the forgotten password view.
*
* @return \Inertia\Response
*/
public function forgotPassword(): \Inertia\Response
public function forgotPassword(): Response
{
return Inertia::render('back/Pages/Auth/ForgotPassword');
}
/**
* Handle an incoming forgotten password request.
*
* @param \App\Http\Requests\Auth\ForgotPasswordRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function postForgotPassword(ForgotPasswordRequest $request): \Illuminate\Http\RedirectResponse
public function postForgotPassword(ForgotPasswordRequest $request): RedirectResponse
{
$status = Password::broker('backend')->sendResetLink(
$request->validated()
@ -98,11 +89,8 @@ class AuthenticatedSessionController extends Controller
/**
* Send a reset password link to the user.
*
* @param \App\Models\User $user
* @return \Illuminate\Http\RedirectResponse
*/
public function sendResetPasswordLink(User $user): \Illuminate\Http\RedirectResponse
public function sendResetPasswordLink(User $user): RedirectResponse
{
$status = Password::broker('backend')->sendResetLink(['email' => $user->email]);
@ -113,11 +101,8 @@ class AuthenticatedSessionController extends Controller
/**
* Display the view.
*
* @param string $token
* @return \Inertia\Response
*/
public function resetPassword(string $token): \Inertia\Response
public function resetPassword(string $token): Response
{
return Inertia::render('back/Pages/Auth/ResetPassword', [
'token' => $token,
@ -127,11 +112,8 @@ class AuthenticatedSessionController extends Controller
/**
* Handle an incoming resetting password request.
*
* @param \App\Http\Requests\Auth\ResetPasswordRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function postResetPassword(ResetPasswordRequest $request): \Illuminate\Http\RedirectResponse
public function postResetPassword(ResetPasswordRequest $request): RedirectResponse
{
$status = Password::broker('backend')->reset(
$request->validated(),
@ -152,6 +134,6 @@ class AuthenticatedSessionController extends Controller
return $status === Password::PASSWORD_RESET
? to_route(config('uwil-backend.routes.name') . 'login')
: back()->withErrors(['email' => trans("auth.token")]);
: back()->withErrors(['email' => trans('auth.token')]);
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Back;
use App\Http\Requests\Back\Brands\StoreBrandRequest;
@ -7,10 +9,13 @@ use App\Http\Requests\Back\Brands\UpdateBrandRequest;
use App\Models\Brand;
use App\Models\Site;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Inertia\Response;
use Uwil\LaravelBackend\Controllers\BackendController;
use Uwil\LaravelBackend\Resources\CommonResource;
@ -24,7 +29,7 @@ class BrandController extends BackendController
*
* @var \Illuminate\Support\Collection<int,\App\Models\Site>
*/
private readonly \Illuminate\Support\Collection $siteModels;
private readonly Collection $siteModels;
/**
* Create the controller instance.
@ -40,11 +45,8 @@ class BrandController extends BackendController
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return \Inertia\Response
*/
public function index(Request $request): \Inertia\Response
public function index(Request $request): Response
{
/** @var \Illuminate\Database\Eloquent\Builder<\App\Models\Brand> $query */
$query = Brand::query();
@ -82,11 +84,8 @@ class BrandController extends BackendController
/**
* Show the form for creating a new resource.
*
* @param \App\Models\Brand $brand
* @return \Inertia\Response
*/
public function create(Brand $brand): \Inertia\Response
public function create(Brand $brand): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Create", [
'data' => CommonResource::make($brand),
@ -96,26 +95,20 @@ class BrandController extends BackendController
/**
* Show a specific resource.
*
* @param \App\Models\Brand $brand
* @return \Inertia\Response
*/
public function show(Brand $brand): \Inertia\Response
public function show(Brand $brand): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Show", [
'data' => CommonResource::make($brand->load([
'sites' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'sites' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
])),
]);
}
/**
* Store a newly created resource.
*
* @param \App\Http\Requests\Back\Brands\StoreBrandRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(StoreBrandRequest $request): \Illuminate\Http\RedirectResponse
public function store(StoreBrandRequest $request): RedirectResponse
{
return DB::transaction(function () use ($request) {
$validatedData = $request->validated();
@ -124,11 +117,13 @@ class BrandController extends BackendController
if ($brand->saveOrFail()) {
$brand->sites()->syncWithoutDetaching(Arr::get($validatedData, 'sites'));
return to_route("{$this->routeName}{$this->modelName}.edit", $brand)
->with('success', trans('uwil-backend::crud.messages.has_been_created', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -138,11 +133,8 @@ class BrandController extends BackendController
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Brand $brand
* @return \Inertia\Response
*/
public function edit(Brand $brand): \Inertia\Response
public function edit(Brand $brand): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Edit", [
'data' => CommonResource::make($brand->load(['sites'])),
@ -152,26 +144,24 @@ class BrandController extends BackendController
/**
* Update the specified resource.
*
* @param \App\Http\Requests\Back\Brands\UpdateBrandRequest $request
* @param \App\Models\Brand $brand
* @return \Illuminate\Http\RedirectResponse
*/
public function update(
UpdateBrandRequest $request,
Brand $brand,
): \Illuminate\Http\RedirectResponse {
): RedirectResponse {
return DB::transaction(function () use ($request, $brand) {
$validatedData = $request->validated();
$brand->fill(Arr::except($validatedData, 'sites'));
if ($brand->saveOrFail()) {
$brand->sites()->sync(Arr::get($validatedData, 'sites'));
return to_route("{$this->routeName}{$this->modelName}.edit", $brand)
->with('success', trans('uwil-backend::crud.messages.has_been_updated', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return to_route("{$this->routeName}{$this->modelName}.edit", $brand)
->with('error', trans('uwil-backend::crud.messages.cannot_be_updated', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -181,25 +171,20 @@ class BrandController extends BackendController
/**
* Duplicate the specified resource.
*
* @param \App\Models\Brand $brand
* @return \Inertia\Response
*/
public function duplicate(Brand $brand): \Inertia\Response
public function duplicate(Brand $brand): Response
{
$brand->loadMissing(Brand::getCacheRelations());
$replica = $brand->replicate();
collect($brand->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
collect($brand->getRelations())->each(fn ($value, $relation) => $replica->setRelation($relation, $value));
return $this->create($replica);
}
/**
* Restore the specified resource.
*
* @param integer $brand
* @return \Illuminate\Http\RedirectResponse
*/
public function restore(int $brand): \Illuminate\Http\RedirectResponse
public function restore(int $brand): RedirectResponse
{
$brand = Brand::withTrashed()->findOrFail($brand);
/** @var array<string,string> */
@ -211,6 +196,7 @@ class BrandController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -219,11 +205,8 @@ class BrandController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\Brand $brand
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(Brand $brand): \Illuminate\Http\RedirectResponse
public function destroy(Brand $brand): RedirectResponse
{
/** @var array<string,string> */
$previousQueries = [];
@ -234,6 +217,7 @@ class BrandController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -242,11 +226,8 @@ class BrandController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\Brand|integer $brand
* @return \Illuminate\Http\RedirectResponse
*/
public function forceDestroy(Brand|int $brand): \Illuminate\Http\RedirectResponse
public function forceDestroy(Brand | int $brand): RedirectResponse
{
if (is_int($brand)) {
$brand = Brand::withTrashed()->findOrFail($brand);
@ -260,6 +241,7 @@ class BrandController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),

View file

@ -1,13 +1,17 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Back;
use App\Http\Requests\Back\InvoiceCompanies\StoreInvoiceCompanyRequest;
use App\Http\Requests\Back\InvoiceCompanies\UpdateInvoiceCompanyRequest;
use App\Models\InvoiceCompany;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Inertia\Response;
use Uwil\LaravelBackend\Controllers\BackendController;
use Uwil\LaravelBackend\Resources\CommonResource;
@ -29,11 +33,8 @@ class InvoiceCompanyController extends BackendController
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return \Inertia\Response
*/
public function index(Request $request): \Inertia\Response
public function index(Request $request): Response
{
/** @var \Illuminate\Database\Eloquent\Builder<\App\Models\InvoiceCompany> $query */
$query = InvoiceCompany::query();
@ -71,11 +72,8 @@ class InvoiceCompanyController extends BackendController
/**
* Show the form for creating a new resource.
*
* @param \App\Models\InvoiceCompany $invoice_company
* @return \Inertia\Response
*/
public function create(InvoiceCompany $invoice_company): \Inertia\Response
public function create(InvoiceCompany $invoice_company): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Create", [
'data' => CommonResource::make($invoice_company),
@ -84,11 +82,8 @@ class InvoiceCompanyController extends BackendController
/**
* Show a specific resource.
*
* @param \App\Models\InvoiceCompany $invoice_company
* @return \Inertia\Response
*/
public function show(InvoiceCompany $invoice_company): \Inertia\Response
public function show(InvoiceCompany $invoice_company): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Show", [
'data' => CommonResource::make($invoice_company),
@ -97,11 +92,8 @@ class InvoiceCompanyController extends BackendController
/**
* Store a newly created resource.
*
* @param \App\Http\Requests\Back\InvoiceCompanies\StoreInvoiceCompanyRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(StoreInvoiceCompanyRequest $request): \Illuminate\Http\RedirectResponse
public function store(StoreInvoiceCompanyRequest $request): RedirectResponse
{
return DB::transaction(function () use ($request) {
$invoice_company = new InvoiceCompany();
@ -113,6 +105,7 @@ class InvoiceCompanyController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -122,11 +115,8 @@ class InvoiceCompanyController extends BackendController
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\InvoiceCompany $invoice_company
* @return \Inertia\Response
*/
public function edit(InvoiceCompany $invoice_company): \Inertia\Response
public function edit(InvoiceCompany $invoice_company): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Edit", [
'data' => CommonResource::make($invoice_company),
@ -135,15 +125,11 @@ class InvoiceCompanyController extends BackendController
/**
* Update the specified resource.
*
* @param \App\Http\Requests\Back\InvoiceCompanies\UpdateInvoiceCompanyRequest $request
* @param \App\Models\InvoiceCompany $invoice_company
* @return \Illuminate\Http\RedirectResponse
*/
public function update(
UpdateInvoiceCompanyRequest $request,
InvoiceCompany $invoice_company
): \Illuminate\Http\RedirectResponse {
): RedirectResponse {
return DB::transaction(function () use ($request, $invoice_company) {
$invoice_company->fill($request->validated());
@ -153,6 +139,7 @@ class InvoiceCompanyController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return to_route("{$this->routeName}{$this->modelName}.edit", $invoice_company)
->with('error', trans('uwil-backend::crud.messages.cannot_be_updated', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -162,26 +149,21 @@ class InvoiceCompanyController extends BackendController
/**
* Duplicate the specified resource.
*
* @param \App\Models\InvoiceCompany $invoice_company
* @return \Inertia\Response
*/
public function duplicate(InvoiceCompany $invoice_company): \Inertia\Response
public function duplicate(InvoiceCompany $invoice_company): Response
{
$invoice_company->loadMissing(InvoiceCompany::getCacheRelations());
$replica = $invoice_company->replicate();
collect($invoice_company->getRelations())
->each(fn($value, $relation) => $replica->setRelation($relation, $value));
->each(fn ($value, $relation) => $replica->setRelation($relation, $value));
return $this->create($replica);
}
/**
* Restore the specified resource.
*
* @param integer $invoice_company
* @return \Illuminate\Http\RedirectResponse
*/
public function restore(int $invoice_company): \Illuminate\Http\RedirectResponse
public function restore(int $invoice_company): RedirectResponse
{
$invoice_company = InvoiceCompany::withTrashed()->findOrFail($invoice_company);
/** @var array<string,string> */
@ -193,6 +175,7 @@ class InvoiceCompanyController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -201,11 +184,8 @@ class InvoiceCompanyController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\InvoiceCompany $invoice_company
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(InvoiceCompany $invoice_company): \Illuminate\Http\RedirectResponse
public function destroy(InvoiceCompany $invoice_company): RedirectResponse
{
/** @var array<string,string> */
$previousQueries = [];
@ -216,6 +196,7 @@ class InvoiceCompanyController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -224,11 +205,8 @@ class InvoiceCompanyController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\InvoiceCompany|integer $invoice_company
* @return \Illuminate\Http\RedirectResponse
*/
public function forceDestroy(InvoiceCompany|int $invoice_company): \Illuminate\Http\RedirectResponse
public function forceDestroy(InvoiceCompany | int $invoice_company): RedirectResponse
{
if (is_int($invoice_company)) {
$invoice_company = InvoiceCompany::withTrashed()->findOrFail($invoice_company);
@ -242,6 +220,7 @@ class InvoiceCompanyController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),

View file

@ -1,13 +1,17 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Back;
use App\Http\Requests\Back\InvoicePackages\StoreInvoicePackageRequest;
use App\Http\Requests\Back\InvoicePackages\UpdateInvoicePackageRequest;
use App\Models\InvoicePackage;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Inertia\Response;
use Uwil\LaravelBackend\Controllers\BackendController;
use Uwil\LaravelBackend\Resources\CommonResource;
@ -29,11 +33,8 @@ class InvoicePackageController extends BackendController
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return \Inertia\Response
*/
public function index(Request $request): \Inertia\Response
public function index(Request $request): Response
{
/** @var \Illuminate\Database\Eloquent\Builder<\App\Models\InvoicePackage> $query */
$query = InvoicePackage::query();
@ -71,11 +72,8 @@ class InvoicePackageController extends BackendController
/**
* Show the form for creating a new resource.
*
* @param \App\Models\InvoicePackage $invoice_package
* @return \Inertia\Response
*/
public function create(InvoicePackage $invoice_package): \Inertia\Response
public function create(InvoicePackage $invoice_package): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Create", [
'data' => CommonResource::make($invoice_package),
@ -84,11 +82,8 @@ class InvoicePackageController extends BackendController
/**
* Show a specific resource.
*
* @param \App\Models\InvoicePackage $invoice_package
* @return \Inertia\Response
*/
public function show(InvoicePackage $invoice_package): \Inertia\Response
public function show(InvoicePackage $invoice_package): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Show", [
'data' => CommonResource::make($invoice_package),
@ -97,11 +92,8 @@ class InvoicePackageController extends BackendController
/**
* Store a newly created resource.
*
* @param \App\Http\Requests\Back\InvoicePackages\StoreInvoicePackageRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(StoreInvoicePackageRequest $request): \Illuminate\Http\RedirectResponse
public function store(StoreInvoicePackageRequest $request): RedirectResponse
{
return DB::transaction(function () use ($request) {
$invoice_package = new InvoicePackage();
@ -113,6 +105,7 @@ class InvoicePackageController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -122,11 +115,8 @@ class InvoicePackageController extends BackendController
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\InvoicePackage $invoice_package
* @return \Inertia\Response
*/
public function edit(InvoicePackage $invoice_package): \Inertia\Response
public function edit(InvoicePackage $invoice_package): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Edit", [
'data' => CommonResource::make($invoice_package),
@ -135,15 +125,11 @@ class InvoicePackageController extends BackendController
/**
* Update the specified resource.
*
* @param \App\Http\Requests\Back\InvoicePackages\UpdateInvoicePackageRequest $request
* @param \App\Models\InvoicePackage $invoice_package
* @return \Illuminate\Http\RedirectResponse
*/
public function update(
UpdateInvoicePackageRequest $request,
InvoicePackage $invoice_package
): \Illuminate\Http\RedirectResponse {
): RedirectResponse {
return DB::transaction(function () use ($request, $invoice_package) {
$invoice_package->fill($request->validated());
@ -153,6 +139,7 @@ class InvoicePackageController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return to_route("{$this->routeName}{$this->modelName}.edit", $invoice_package)
->with('error', trans('uwil-backend::crud.messages.cannot_be_updated', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -162,26 +149,21 @@ class InvoicePackageController extends BackendController
/**
* Duplicate the specified resource.
*
* @param \App\Models\InvoicePackage $invoice_package
* @return \Inertia\Response
*/
public function duplicate(InvoicePackage $invoice_package): \Inertia\Response
public function duplicate(InvoicePackage $invoice_package): Response
{
$invoice_package->loadMissing(InvoicePackage::getCacheRelations());
$replica = $invoice_package->replicate();
collect($invoice_package->getRelations())
->each(fn($value, $relation) => $replica->setRelation($relation, $value));
->each(fn ($value, $relation) => $replica->setRelation($relation, $value));
return $this->create($replica);
}
/**
* Restore the specified resource.
*
* @param integer $invoice_package
* @return \Illuminate\Http\RedirectResponse
*/
public function restore(int $invoice_package): \Illuminate\Http\RedirectResponse
public function restore(int $invoice_package): RedirectResponse
{
$invoice_package = InvoicePackage::withTrashed()->findOrFail($invoice_package);
/** @var array<string,string> */
@ -193,6 +175,7 @@ class InvoicePackageController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -201,11 +184,8 @@ class InvoicePackageController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\InvoicePackage $invoice_package
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(InvoicePackage $invoice_package): \Illuminate\Http\RedirectResponse
public function destroy(InvoicePackage $invoice_package): RedirectResponse
{
/** @var array<string,string> */
$previousQueries = [];
@ -216,6 +196,7 @@ class InvoicePackageController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -224,11 +205,8 @@ class InvoicePackageController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\InvoicePackage|integer $invoice_package
* @return \Illuminate\Http\RedirectResponse
*/
public function forceDestroy(InvoicePackage|int $invoice_package): \Illuminate\Http\RedirectResponse
public function forceDestroy(InvoicePackage | int $invoice_package): RedirectResponse
{
if (is_int($invoice_package)) {
$invoice_package = InvoicePackage::withTrashed()->findOrFail($invoice_package);
@ -242,6 +220,7 @@ class InvoicePackageController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),

View file

@ -1,13 +1,17 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Back;
use App\Http\Requests\Back\Notices\StoreNoticeRequest;
use App\Http\Requests\Back\Notices\UpdateNoticeRequest;
use App\Models\Notice;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Inertia\Response;
use Uwil\LaravelBackend\Controllers\BackendController;
use Uwil\LaravelBackend\Resources\CommonResource;
@ -29,11 +33,8 @@ class NoticeController extends BackendController
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return \Inertia\Response
*/
public function index(Request $request): \Inertia\Response
public function index(Request $request): Response
{
/** @var \Illuminate\Database\Eloquent\Builder<\App\Models\Notice> $query */
$query = Notice::query();
@ -71,11 +72,8 @@ class NoticeController extends BackendController
/**
* Show the form for creating a new resource.
*
* @param \App\Models\Notice $notice
* @return \Inertia\Response
*/
public function create(Notice $notice): \Inertia\Response
public function create(Notice $notice): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Create", [
'data' => CommonResource::make($notice),
@ -84,11 +82,8 @@ class NoticeController extends BackendController
/**
* Show a specific resource.
*
* @param \App\Models\Notice $notice
* @return \Inertia\Response
*/
public function show(Notice $notice): \Inertia\Response
public function show(Notice $notice): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Show", [
'data' => CommonResource::make($notice),
@ -97,11 +92,8 @@ class NoticeController extends BackendController
/**
* Store a newly created resource.
*
* @param \App\Http\Requests\Back\Notices\StoreNoticeRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(StoreNoticeRequest $request): \Illuminate\Http\RedirectResponse
public function store(StoreNoticeRequest $request): RedirectResponse
{
return DB::transaction(function () use ($request) {
$notice = new Notice();
@ -113,6 +105,7 @@ class NoticeController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -122,11 +115,8 @@ class NoticeController extends BackendController
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Notice $notice
* @return \Inertia\Response
*/
public function edit(Notice $notice): \Inertia\Response
public function edit(Notice $notice): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Edit", [
'data' => CommonResource::make($notice),
@ -135,15 +125,11 @@ class NoticeController extends BackendController
/**
* Update the specified resource.
*
* @param \App\Http\Requests\Back\Notices\UpdateNoticeRequest $request
* @param \App\Models\Notice $notice
* @return \Illuminate\Http\RedirectResponse
*/
public function update(
UpdateNoticeRequest $request,
Notice $notice
): \Illuminate\Http\RedirectResponse {
): RedirectResponse {
return DB::transaction(function () use ($request, $notice) {
$notice->fill($request->validated());
@ -153,6 +139,7 @@ class NoticeController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return to_route("{$this->routeName}{$this->modelName}.edit", $notice)
->with('error', trans('uwil-backend::crud.messages.cannot_be_updated', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -162,25 +149,20 @@ class NoticeController extends BackendController
/**
* Duplicate the specified resource.
*
* @param \App\Models\Notice $notice
* @return \Inertia\Response
*/
public function duplicate(Notice $notice): \Inertia\Response
public function duplicate(Notice $notice): Response
{
$notice->loadMissing(Notice::getCacheRelations());
$replica = $notice->replicate();
collect($notice->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
collect($notice->getRelations())->each(fn ($value, $relation) => $replica->setRelation($relation, $value));
return $this->create($replica);
}
/**
* Restore the specified resource.
*
* @param integer $notice
* @return \Illuminate\Http\RedirectResponse
*/
public function restore(int $notice): \Illuminate\Http\RedirectResponse
public function restore(int $notice): RedirectResponse
{
$notice = Notice::withTrashed()->findOrFail($notice);
/** @var array<string,string> */
@ -192,6 +174,7 @@ class NoticeController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -200,11 +183,8 @@ class NoticeController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\Notice $notice
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(Notice $notice): \Illuminate\Http\RedirectResponse
public function destroy(Notice $notice): RedirectResponse
{
/** @var array<string,string> */
$previousQueries = [];
@ -215,6 +195,7 @@ class NoticeController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -223,11 +204,8 @@ class NoticeController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\Notice|integer $notice
* @return \Illuminate\Http\RedirectResponse
*/
public function forceDestroy(Notice|int $notice): \Illuminate\Http\RedirectResponse
public function forceDestroy(Notice | int $notice): RedirectResponse
{
if (is_int($notice)) {
$notice = Notice::withTrashed()->findOrFail($notice);
@ -241,6 +219,7 @@ class NoticeController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Back;
use App\Http\Requests\Back\Sites\StoreSiteRequest;
@ -7,10 +9,13 @@ use App\Http\Requests\Back\Sites\UpdateSiteRequest;
use App\Models\Site;
use App\Models\User;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Inertia\Response;
use Uwil\LaravelBackend\Controllers\BackendController;
use Uwil\LaravelBackend\Resources\CommonResource;
use Uwil\LaravelBackend\Support\UserRoleRegistry;
@ -25,14 +30,14 @@ class SiteController extends BackendController
*
* @var \Illuminate\Support\Collection<int,\App\Models\User>
*/
private readonly \Illuminate\Support\Collection $userModelsProjectManager;
private readonly Collection $userModelsProjectManager;
/**
* Project managers collection.
*
* @var \Illuminate\Support\Collection<int,\App\Models\User>
*/
private readonly \Illuminate\Support\Collection $userModelsClient;
private readonly Collection $userModelsClient;
/**
* Create the controller instance.
@ -46,24 +51,21 @@ class SiteController extends BackendController
/** @var \Illuminate\Support\Collection<int, \App\Models\User> $userModels */
$userModels = User::getModelsCached()
->where("published", true)
->where('published', true)
->where('deleted_at', null)
->values();
$this->userModelsProjectManager = $userModels
->filter(fn(User $user) => $user->role->value === UserRoleRegistry::get('project-manager')->value)
->filter(fn (User $user) => $user->role->value === UserRoleRegistry::get('project-manager')->value)
->values();
$this->userModelsClient = $userModels
->filter(fn(User $user) => $user->role->value === UserRoleRegistry::get('client')->value)
->filter(fn (User $user) => $user->role->value === UserRoleRegistry::get('client')->value)
->values();
}
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return \Inertia\Response
*/
public function index(Request $request): \Inertia\Response
public function index(Request $request): Response
{
/** @var \App\Models\User $userModel */
$userModel = auth('backend')->user();
@ -72,7 +74,7 @@ class SiteController extends BackendController
$query = Site::query()
->when(
$userModel->role->value === UserRoleRegistry::get('client')->value,
fn($query) => $query->whereIn('id', $userModel->sites->modelKeys()),
fn ($query) => $query->whereIn('id', $userModel->sites->modelKeys()),
)
->with(['projectManager', 'gitlabProject']);
@ -109,11 +111,8 @@ class SiteController extends BackendController
/**
* Show the form for creating a new resource.
*
* @param \App\Models\Site $site
* @return \Inertia\Response
*/
public function create(Site $site): \Inertia\Response
public function create(Site $site): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Create", [
'data' => CommonResource::make($site),
@ -124,17 +123,14 @@ class SiteController extends BackendController
/**
* Show a specific resource.
*
* @param \App\Models\Site $site
* @return \Inertia\Response
*/
public function show(Site $site): \Inertia\Response
public function show(Site $site): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Show", [
'data' => CommonResource::make($site->load([
'projectManager' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'gitlabProject' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'users' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'projectManager' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'gitlabProject' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'users' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
])),
'userModelsProjectManager' => $this->userModelsProjectManager,
'userModelsClient' => $this->userModelsClient,
@ -143,11 +139,8 @@ class SiteController extends BackendController
/**
* Store a newly created resource.
*
* @param \App\Http\Requests\Back\Sites\StoreSiteRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(StoreSiteRequest $request): \Illuminate\Http\RedirectResponse
public function store(StoreSiteRequest $request): RedirectResponse
{
return DB::transaction(function () use ($request) {
$validatedData = $request->validated();
@ -156,11 +149,13 @@ class SiteController extends BackendController
if ($site->saveOrFail()) {
$site->users()->syncWithoutDetaching(Arr::get($validatedData, 'users'));
return to_route("{$this->routeName}{$this->modelName}.edit", $site)
->with('success', trans('uwil-backend::crud.messages.has_been_created', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -170,17 +165,14 @@ class SiteController extends BackendController
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Site $site
* @return \Inertia\Response
*/
public function edit(Site $site): \Inertia\Response
public function edit(Site $site): Response
{
return $this->inertiaRender("back/Pages/$this->modelPage/Edit", [
'data' => CommonResource::make($site->load([
'projectManager' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'gitlabProject' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'users' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'projectManager' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'gitlabProject' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'users' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
])),
'userModelsProjectManager' => $this->userModelsProjectManager,
'userModelsClient' => $this->userModelsClient,
@ -189,26 +181,24 @@ class SiteController extends BackendController
/**
* Update the specified resource.
*
* @param \App\Http\Requests\Back\Sites\UpdateSiteRequest $request
* @param \App\Models\Site $site
* @return \Illuminate\Http\RedirectResponse
*/
public function update(
UpdateSiteRequest $request,
Site $site
): \Illuminate\Http\RedirectResponse {
): RedirectResponse {
return DB::transaction(function () use ($request, $site) {
$validatedData = $request->validated();
$site->fill(Arr::except($validatedData, 'users'));
if ($site->saveOrFail()) {
$site->users()->sync(Arr::get($validatedData, 'users'));
return to_route("{$this->routeName}{$this->modelName}.edit", $site)
->with('success', trans('uwil-backend::crud.messages.has_been_updated', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return to_route("{$this->routeName}{$this->modelName}.edit", $site)
->with('error', trans('uwil-backend::crud.messages.cannot_be_updated', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -218,25 +208,20 @@ class SiteController extends BackendController
/**
* Duplicate the specified resource.
*
* @param \App\Models\Site $site
* @return \Inertia\Response
*/
public function duplicate(Site $site): \Inertia\Response
public function duplicate(Site $site): Response
{
$site->loadMissing(Site::getCacheRelations());
$replica = $site->replicate();
collect($site->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
collect($site->getRelations())->each(fn ($value, $relation) => $replica->setRelation($relation, $value));
return $this->create($replica);
}
/**
* Restore the specified resource.
*
* @param integer $site
* @return \Illuminate\Http\RedirectResponse
*/
public function restore(int $site): \Illuminate\Http\RedirectResponse
public function restore(int $site): RedirectResponse
{
$site = Site::withTrashed()->findOrFail($site);
/** @var array<string,string> */
@ -248,6 +233,7 @@ class SiteController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -256,11 +242,8 @@ class SiteController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\Site $site
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(Site $site): \Illuminate\Http\RedirectResponse
public function destroy(Site $site): RedirectResponse
{
/** @var array<string,string> */
$previousQueries = [];
@ -271,6 +254,7 @@ class SiteController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
@ -279,11 +263,8 @@ class SiteController extends BackendController
/**
* Destroy the specified resource.
*
* @param \App\Models\Site|integer $site
* @return \Illuminate\Http\RedirectResponse
*/
public function forceDestroy(Site|int $site): \Illuminate\Http\RedirectResponse
public function forceDestroy(Site | int $site): RedirectResponse
{
if (is_int($site)) {
$site = Site::withTrashed()->findOrFail($site);
@ -297,6 +278,7 @@ class SiteController extends BackendController
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
]));
}
return back()
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),

View file

@ -1,7 +1,10 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Back;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Uwil\LaravelBackend\Controllers\UserController as BackendUserController;
@ -15,16 +18,12 @@ class UserController extends BackendUserController
/**
* Update the specified resource.
*
* @param \Illuminate\Http\Request $request
* @param mixed $callback
* @return \Illuminate\Http\RedirectResponse
*/
#[\Override]
public function store(
Request $request,
mixed $callback = null,
): \Illuminate\Http\RedirectResponse {
): RedirectResponse {
return parent::store($request, function ($request, $user): void {
$validatedData = $request->validated();
$user->sites()->syncWithoutDetaching(Arr::get($validatedData, 'sites'));
@ -38,18 +37,13 @@ class UserController extends BackendUserController
/**
* Update the specified resource.
*
* @param \Illuminate\Http\Request $request
* @param mixed $user
* @param mixed $callback
* @return \Illuminate\Http\RedirectResponse
*/
#[\Override]
public function update(
Request $request,
mixed $user,
mixed $callback = null,
): \Illuminate\Http\RedirectResponse {
): RedirectResponse {
return parent::update($request, $user, function ($request, $user): void {
$validatedData = $request->validated();
$user->sites()->sync(Arr::get($validatedData, 'sites'));

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Auth;
use Illuminate\Foundation\Http\FormRequest;

View file

@ -1,7 +1,10 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Auth;
use App\Models\User;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
@ -33,7 +36,7 @@ class LoginRequest extends BackendLoginRequest
->mixedCase()
->numbers()
->symbols()
->uncompromised()
->uncompromised(),
],
'remember' => 'boolean',
];
@ -56,7 +59,6 @@ class LoginRequest extends BackendLoginRequest
/**
* Attempt to authenticate the request's credentials.
*
* @return void
* @throws \Illuminate\Validation\ValidationException Wrong email.
*/
#[\Override]
@ -64,14 +66,14 @@ class LoginRequest extends BackendLoginRequest
{
$this->ensureIsNotRateLimited();
$user = \App\Models\User::query()
$user = User::query()
->where('email', $this->input('email'))
->first();
if (
!$user
|| !$user->userPassword
|| !Hash::check($this->input('password'), $user->userPassword->password)
! $user
|| ! $user->userPassword
|| ! Hash::check($this->input('password'), $user->userPassword->password)
) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
@ -86,7 +88,6 @@ class LoginRequest extends BackendLoginRequest
/**
* Ensure the login request is not rate limited.
*
* @return void
* @throws \Illuminate\Validation\ValidationException Wrong email.
*/
#[\Override]

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Auth;
use Illuminate\Foundation\Http\FormRequest;
@ -18,6 +20,7 @@ class ResetPasswordRequest extends FormRequest
public function rules(): array
{
$passwordRules = Password::min(8)->letters()->mixedCase()->numbers()->symbols()->uncompromised();
return [
'token' => 'required|string',
'email' => 'required|string|email:rfc,strict,dns,spoof,filter',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Brands;
use App\Models\Brand;
@ -13,8 +15,6 @@ class StoreBrandRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Brands;
use Illuminate\Support\Facades\Gate;
@ -12,8 +14,6 @@ class UpdateBrandRequest extends StoreBrandRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
#[\Override]
public function authorize(): bool
@ -31,6 +31,7 @@ class UpdateBrandRequest extends StoreBrandRequest
{
/** @var \App\Models\Brand $brand */
$brand = $this->route('brand');
return array_merge(parent::rules(), [
'name' => [
'required',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\InvoiceCompanies;
use App\Models\InvoiceCompany;
@ -13,8 +15,6 @@ class StoreInvoiceCompanyRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\InvoiceCompanies;
use Illuminate\Support\Facades\Gate;
@ -11,8 +13,6 @@ class UpdateInvoiceCompanyRequest extends StoreInvoiceCompanyRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
#[\Override]
public function authorize(): bool

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\InvoicePackages;
use App\Models\InvoicePackage;
@ -13,8 +15,6 @@ class StoreInvoicePackageRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\InvoicePackages;
use Illuminate\Support\Facades\Gate;
@ -11,8 +13,6 @@ class UpdateInvoicePackageRequest extends StoreInvoicePackageRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
#[\Override]
public function authorize(): bool

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Notices;
use App\Enums\NoticeTypeEnum;
@ -16,8 +18,6 @@ class StoreNoticeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Notices;
use Illuminate\Support\Facades\Gate;
@ -11,8 +13,6 @@ class UpdateNoticeRequest extends StoreNoticeRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
#[\Override]
public function authorize(): bool

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Sites;
use App\Models\Site;
@ -13,8 +15,6 @@ class StoreSiteRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{
@ -23,8 +23,6 @@ class StoreSiteRequest extends FormRequest
/**
* Prepare the data for validation.
*
* @return void
*/
#[\Override]
protected function prepareForValidation(): void

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Sites;
use Illuminate\Support\Facades\Gate;
@ -12,8 +14,6 @@ class UpdateSiteRequest extends StoreSiteRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
#[\Override]
public function authorize(): bool
@ -31,6 +31,7 @@ class UpdateSiteRequest extends StoreSiteRequest
{
/** @var \App\Models\Site $site */
$site = $this->route('site');
return array_merge(parent::rules(), [
'name' => [
'required',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Users\Concerns;
use Uwil\LaravelBackend\Support\UserRoleRegistry;
@ -12,11 +14,12 @@ trait HasUserRequestRules
/**
* Resolve role flags from the current request input.
*
* @return array{isClient:boolean,isProjectManager:boolean,isDevelopper:boolean}
* @return array{isClient:bool,isProjectManager:bool,isDevelopper:bool}
*/
private function resolveRoleFlags(): array
{
$role = $this->input('role');
return [
'isClient' => $role === UserRoleRegistry::get('client')->value,
'isProjectManager' => $role === UserRoleRegistry::get('project-manager')->value,
@ -26,8 +29,6 @@ trait HasUserRequestRules
/**
* Prepare the data for validation.
*
* @return void
*/
protected function extraPrepareForValidation(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Users;
use App\Http\Requests\Back\Users\Concerns\HasUserRequestRules;
@ -14,8 +16,6 @@ class StoreUserRequest extends BackendStoreUserRequest
/**
* Prepare the data for validation.
*
* @return void
*/
#[\Override]
protected function prepareForValidation(): void

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Back\Users;
use App\Http\Requests\Back\Users\Concerns\HasUserRequestRules;
@ -14,8 +16,6 @@ class UpdateUserRequest extends BackendUpdateUserRequest
/**
* Prepare the data for validation.
*
* @return void
*/
#[\Override]
protected function prepareForValidation(): void

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Mails\Auth;
use Illuminate\Mail\Mailable;
@ -11,8 +13,6 @@ class LinkResetPasswordMail extends Mailable
/**
* Create a new message instance.
*
* @param string $url
* @param mixed $user
* @return void
*/
public function __construct(
@ -23,10 +23,8 @@ class LinkResetPasswordMail extends Mailable
/**
* Get the message envelope.
*
* @return \Illuminate\Mail\Mailables\Envelope
*/
public function envelope(): \Illuminate\Mail\Mailables\Envelope
public function envelope(): Envelope
{
return new Envelope(
to: $this->user->getEmailForPasswordReset(),
@ -40,10 +38,8 @@ class LinkResetPasswordMail extends Mailable
/**
* Get the message content definition.
*
* @return \Illuminate\Mail\Mailables\Content
*/
public function content(): \Illuminate\Mail\Mailables\Content
public function content(): Content
{
return new Content(
markdown: 'back.mails.link-reset-password',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Mails\Auth;
use App\Models\User;
@ -9,15 +11,11 @@ use Illuminate\Mail\Mailables\Envelope;
class ResetPassword extends Mailable
{
/**
* @var \App\Models\User $user
*/
private readonly User $user;
/**
* Create a new message instance.
*
* @param \App\Models\User $user
* @return void
*/
public function __construct(User $user)
@ -27,10 +25,8 @@ class ResetPassword extends Mailable
/**
* Get the message envelope.
*
* @return \Illuminate\Mail\Mailables\Envelope
*/
public function envelope(): \Illuminate\Mail\Mailables\Envelope
public function envelope(): Envelope
{
return new Envelope(
to: [$this->user->getEmailForPasswordReset()],
@ -44,10 +40,8 @@ class ResetPassword extends Mailable
/**
* Get the message content definition.
*
* @return \Illuminate\Mail\Mailables\Content
*/
public function content(): \Illuminate\Mail\Mailables\Content
public function content(): Content
{
return new Content(
markdown: 'back.mails.reset-password',

View file

@ -1,9 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Uwil\LaravelActivityLogs\Traits\HasActivityLog;
use Uwil\LaravelBackend\Traits\Models\HasCache;
@ -12,8 +15,8 @@ use Uwil\LaravelI18n\Helpers\TranslationHelper;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the brand.
* @property string $name Name of the brand.
* @property int $id Primary key of the brand.
* @property string $name Name of the brand.
* @property-read \Illuminate\Support\Carbon $created_at Date the brand was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the brand was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the brand was deleted.
@ -22,8 +25,10 @@ class Brand extends Model
{
use HasActivityLog;
use HasCache;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\BrandFactory> */
use HasFactory;
use HasModelNaming;
use HasTranslations;
use SoftDeletes;
@ -49,8 +54,6 @@ class Brand extends Model
/**
* Perform any actions required after the model boots.
*
* @return void
*/
#[\Override]
protected static function booted(): void
@ -77,9 +80,6 @@ class Brand extends Model
/**
* Manage model fields.
*
* @param self $model
* @return void
*/
private static function manageFields(self $model): void
{
@ -93,7 +93,7 @@ class Brand extends Model
*
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Site,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
*/
public function sites(): \Illuminate\Database\Eloquent\Relations\MorphToMany
public function sites(): MorphToMany
{
return $this->morphToMany(
Site::class,

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -10,29 +12,31 @@ use Uwil\LaravelI18n\Interfaces\TranslatableModel;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the gitlab issue.
* @property string $name Name of the gitlab issue.
* @property string $url Url of the gitlab issue.
* @property string $estimate_time Estimate time of the gitlab issue.
* @property string $spent_time Spend time of the gitlab issue.
* @property string $is_closed Closed status of the gitlab issue.
* @property string $gitlab_id Gitlab id of the gitlab issue.
* @property string $gitlab_iid Gitlab iid of the gitlab issue.
* @property string $milestone_iid Milestone iid of the gitlab issue.
* @property string $gitlab_project_id Gitlab project id of the gitlab issue.
* @property string $g_created_at Created at date of the gitlab issue.
* @property string $g_updated_at Updated at date of the gitlab issue.
* @property string $g_closed_at Closed at date of the gitlab issue.
* @property string $g_due_date Due at date of the gitlab issue.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab issue was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab issue was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab issue was deleted.
* @property int $id Primary key of the gitlab issue.
* @property string $name Name of the gitlab issue.
* @property string $url Url of the gitlab issue.
* @property string $estimate_time Estimate time of the gitlab issue.
* @property string $spent_time Spend time of the gitlab issue.
* @property string $is_closed Closed status of the gitlab issue.
* @property string $gitlab_id Gitlab id of the gitlab issue.
* @property string $gitlab_iid Gitlab iid of the gitlab issue.
* @property string $milestone_iid Milestone iid of the gitlab issue.
* @property string $gitlab_project_id Gitlab project id of the gitlab issue.
* @property string $g_created_at Created at date of the gitlab issue.
* @property string $g_updated_at Updated at date of the gitlab issue.
* @property string $g_closed_at Closed at date of the gitlab issue.
* @property string $g_due_date Due at date of the gitlab issue.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab issue was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab issue was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab issue was deleted.
*/
class GitlabIssue extends Model implements TranslatableModel
{
use HasActivityLog;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\GitlabIssueFactory> */
use HasFactory;
use HasTranslations;
/**
@ -42,19 +46,19 @@ class GitlabIssue extends Model implements TranslatableModel
*/
#[\Override]
protected $fillable = [
"title",
"url",
"estimate_time",
"spent_time",
"is_closed",
"gitlab_id",
"gitlab_iid",
"milestone_iid",
"gitlab_project_id",
"g_created_at",
"g_updated_at",
"g_closed_at",
"g_due_date",
'title',
'url',
'estimate_time',
'spent_time',
'is_closed',
'gitlab_id',
'gitlab_iid',
'milestone_iid',
'gitlab_project_id',
'g_created_at',
'g_updated_at',
'g_closed_at',
'g_due_date',
];
/**
@ -63,7 +67,7 @@ class GitlabIssue extends Model implements TranslatableModel
* @var list<string>
*/
public $translatable = [
"title",
'title',
];
/**
@ -78,8 +82,6 @@ class GitlabIssue extends Model implements TranslatableModel
/**
* Perform any actions required after the model boots.
*
* @return void
*/
#[\Override]
protected static function booted(): void
@ -96,9 +98,6 @@ class GitlabIssue extends Model implements TranslatableModel
/**
* Manage model fields.
*
* @param self $model
* @return void
*/
private static function manageFields(self $model): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -7,8 +9,8 @@ use Illuminate\Database\Eloquent\Model;
use Uwil\LaravelActivityLogs\Traits\HasActivityLog;
/**
* @property \Illuminate\Support\Carbon $issue_id Gitlab issue id of the relation.
* @property \Illuminate\Support\Carbon $label_id Gitlab label id of the relation.
* @property \Illuminate\Support\Carbon $issue_id Gitlab issue id of the relation.
* @property \Illuminate\Support\Carbon $label_id Gitlab label id of the relation.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab issue label was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab issue label was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab issue label was deleted.
@ -16,6 +18,7 @@ use Uwil\LaravelActivityLogs\Traits\HasActivityLog;
class GitlabIssueLabel extends Model
{
use HasActivityLog;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\GitlabIssueLabelFactory> */
use HasFactory;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -10,9 +12,9 @@ use Uwil\LaravelI18n\Interfaces\TranslatableModel;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the gitlab label.
* @property string $name Name of the gitlab label.
* @property integer $gitlab_id Gitlab id of the gitlab label.
* @property int $id Primary key of the gitlab label.
* @property string $name Name of the gitlab label.
* @property int $gitlab_id Gitlab id of the gitlab label.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab label was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab label was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab label was deleted.
@ -20,8 +22,10 @@ use Uwil\LaravelI18n\Traits\Models\HasTranslations;
class GitlabLabel extends Model implements TranslatableModel
{
use HasActivityLog;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\GitlabLabelFactory> */
use HasFactory;
use HasTranslations;
/**
@ -46,8 +50,6 @@ class GitlabLabel extends Model implements TranslatableModel
/**
* Perform any actions required after the model boots.
*
* @return void
*/
#[\Override]
protected static function booted(): void
@ -64,9 +66,6 @@ class GitlabLabel extends Model implements TranslatableModel
/**
* Manage model fields.
*
* @param self $model
* @return void
*/
private static function manageFields(self $model): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -10,26 +12,28 @@ use Uwil\LaravelI18n\Interfaces\TranslatableModel;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the gitlab milestone.
* @property string $title Title of the gitlab milestone.
* @property string $url Url of the gitlab milestone.
* @property string $is_closed Closed status of the gitlab milestone.
* @property string $gitlab_id Gitlab id of the gitlab milestone.
* @property string $gitlab_iid Gitlab iid of the gitlab milestone.
* @property string $gitlab_project_id Gitlab project id of the gitlab milestone.
* @property string $g_created_at Created at date of the gitlab milestone.
* @property string $g_updated_at Updated at date of the gitlab milestone.
* @property string $g_closed_at Closed at date of the gitlab milestone.
* @property string $g_due_date Due at date of the gitlab milestone.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab milestone was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab milestone was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab milestone was deleted.
* @property int $id Primary key of the gitlab milestone.
* @property string $title Title of the gitlab milestone.
* @property string $url Url of the gitlab milestone.
* @property string $is_closed Closed status of the gitlab milestone.
* @property string $gitlab_id Gitlab id of the gitlab milestone.
* @property string $gitlab_iid Gitlab iid of the gitlab milestone.
* @property string $gitlab_project_id Gitlab project id of the gitlab milestone.
* @property string $g_created_at Created at date of the gitlab milestone.
* @property string $g_updated_at Updated at date of the gitlab milestone.
* @property string $g_closed_at Closed at date of the gitlab milestone.
* @property string $g_due_date Due at date of the gitlab milestone.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab milestone was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab milestone was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab milestone was deleted.
*/
class GitlabMilestone extends Model implements TranslatableModel
{
use HasActivityLog;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\GitlabMilestoneFactory> */
use HasFactory;
use HasTranslations;
/**
@ -39,16 +43,16 @@ class GitlabMilestone extends Model implements TranslatableModel
*/
#[\Override]
protected $fillable = [
"title",
"url",
"is_closed",
"gitlab_id",
"gitlab_iid",
"gitlab_project_id",
"g_created_at",
"g_updated_at",
"g_closed_at",
"g_due_date",
'title',
'url',
'is_closed',
'gitlab_id',
'gitlab_iid',
'gitlab_project_id',
'g_created_at',
'g_updated_at',
'g_closed_at',
'g_due_date',
];
/**
@ -57,7 +61,7 @@ class GitlabMilestone extends Model implements TranslatableModel
* @var list<string>
*/
public $translatable = [
"title",
'title',
];
/**
@ -72,8 +76,6 @@ class GitlabMilestone extends Model implements TranslatableModel
/**
* Perform any actions required after the model boots.
*
* @return void
*/
#[\Override]
protected static function booted(): void
@ -90,9 +92,6 @@ class GitlabMilestone extends Model implements TranslatableModel
/**
* Manage model fields.
*
* @param self $model
* @return void
*/
private static function manageFields(self $model): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -11,21 +13,23 @@ use Uwil\LaravelI18n\Interfaces\TranslatableModel;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the gitlab project.
* @property string $name Name of the gitlab project.
* @property string $url Url of the gitlab project.
* @property string $is_archived Archived status of the gitlab project.
* @property integer $gitlab_id Gitlab id of the gitlab project.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab project was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab project was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab project was deleted.
* @property int $id Primary key of the gitlab project.
* @property string $name Name of the gitlab project.
* @property string $url Url of the gitlab project.
* @property string $is_archived Archived status of the gitlab project.
* @property int $gitlab_id Gitlab id of the gitlab project.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab project was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab project was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the gitlab project was deleted.
*/
class GitlabProject extends Model implements TranslatableModel
{
use HasActivityLog;
use HasCache;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\GitlabProjectFactory> */
use HasFactory;
use HasTranslations;
/**
@ -62,8 +66,6 @@ class GitlabProject extends Model implements TranslatableModel
/**
* Perform any actions required after the model boots.
*
* @return void
*/
#[\Override]
protected static function booted(): void
@ -80,9 +82,6 @@ class GitlabProject extends Model implements TranslatableModel
/**
* Manage model fields.
*
* @param self $model
* @return void
*/
private static function manageFields(self $model): void
{

View file

@ -1,14 +1,16 @@
<?php
declare(strict_types=1);
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property integer $id Primary key of the gitlab user.
* @property integer $user_id Gitlab id of the user.
* @property integer $gitlab_id Id of the user.
* @property int $id Primary key of the gitlab user.
* @property int $user_id Gitlab id of the user.
* @property int $gitlab_id Id of the user.
* @property-read \Illuminate\Support\Carbon $created_at Date the gitlab user was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the gitlab user was updated.
*/
@ -32,7 +34,7 @@ class GitlabUser extends Model
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User,$this>
*/
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -11,8 +13,8 @@ use Uwil\LaravelBackend\Traits\Models\HasModelNaming;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the invoice company.
* @property string $name Name of the invoice company.
* @property int $id Primary key of the invoice company.
* @property string $name Name of the invoice company.
* @property-read \Illuminate\Support\Carbon $created_at Date the invoice company was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the invoice company was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the invoice company was deleted.
@ -21,8 +23,10 @@ class InvoiceCompany extends Model
{
use HasActivityLog;
use HasCache;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\InvoiceCompanyFactory> */
use HasFactory;
use HasModelNaming;
use HasTranslations;
use SoftDeletes;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -11,10 +13,10 @@ use Uwil\LaravelBackend\Traits\Models\HasModelNaming;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the invoice package.
* @property string $name Name of the invoice package.
* @property string $amount Amount of the invoice package.
* @property string $published Published status of the invoice package.
* @property int $id Primary key of the invoice package.
* @property string $name Name of the invoice package.
* @property string $amount Amount of the invoice package.
* @property string $published Published status of the invoice package.
* @property-read \Illuminate\Support\Carbon $created_at Date the invoice package password was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the invoice package password was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the invoice package password was deleted.
@ -23,8 +25,10 @@ class InvoicePackage extends Model
{
use HasActivityLog;
use HasCache;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\InvoicePackageFactory> */
use HasFactory;
use HasModelNaming;
use HasTranslations;
use SoftDeletes;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use App\Enums\NoticeTypeEnum;
@ -12,10 +14,10 @@ use Uwil\LaravelBackend\Traits\Models\HasModelNaming;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the notice.
* @property string $title Title of the notice.
* @property string $message Message of the notice.
* @property integer $type Type of the notice.
* @property int $id Primary key of the notice.
* @property string $title Title of the notice.
* @property string $message Message of the notice.
* @property int $type Type of the notice.
* @property-read \Illuminate\Support\Carbon $created_at Date the notice password was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the notice password was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the notice password was deleted.
@ -24,8 +26,10 @@ class Notice extends Model
{
use HasActivityLog;
use HasCache;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\NoticeFactory> */
use HasFactory;
use HasModelNaming;
use HasTranslations;
use SoftDeletes;

View file

@ -1,9 +1,13 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Uwil\LaravelActivityLogs\Traits\HasActivityLog;
use Uwil\LaravelBackend\Traits\Models\HasCache;
@ -13,21 +17,23 @@ use Uwil\LaravelI18n\Helpers\TranslationHelper;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Primary key of the site.
* @property string $name Name of the site.
* @property string $url_re7 Re7 url of the site.
* @property string $url_prod Prod url of the site.
* @property \App\Models\User $project_manager_id Project manager associated.
* @property-read \Illuminate\Support\Carbon $created_at Date the site was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the site was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the site was deleted.
* @property int $id Primary key of the site.
* @property string $name Name of the site.
* @property string $url_re7 Re7 url of the site.
* @property string $url_prod Prod url of the site.
* @property \App\Models\User $project_manager_id Project manager associated.
* @property-read \Illuminate\Support\Carbon $created_at Date the site was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the site was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the site was deleted.
*/
class Site extends Model
{
use HasActivityLog;
use HasCache;
/** @use \Illuminate\Database\Eloquent\Factories\HasFactory<\Database\Factories\SiteFactory> */
use HasFactory;
use HasModelNaming;
use HasTranslations;
use SoftDeletes;
@ -57,8 +63,6 @@ class Site extends Model
/**
* Perform any actions required after the model boots.
*
* @return void
*/
#[\Override]
protected static function booted(): void
@ -75,9 +79,6 @@ class Site extends Model
/**
* Manage model fields.
*
* @param self $model
* @return void
*/
private static function manageFields(self $model): void
{
@ -107,7 +108,7 @@ class Site extends Model
*
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\User,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
*/
public function users(): \Illuminate\Database\Eloquent\Relations\MorphToMany
public function users(): MorphToMany
{
return $this->morphedByMany(
User::class,
@ -123,7 +124,7 @@ class Site extends Model
*
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Brand,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
*/
public function brands(): \Illuminate\Database\Eloquent\Relations\MorphToMany
public function brands(): MorphToMany
{
return $this->morphedByMany(
Brand::class,
@ -139,7 +140,7 @@ class Site extends Model
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User,$this>
*/
public function projectManager(): \Illuminate\Database\Eloquent\Relations\BelongsTo
public function projectManager(): BelongsTo
{
return $this->belongsTo(User::class, 'project_manager_id');
}
@ -149,7 +150,7 @@ class Site extends Model
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\GitlabProject,$this>
*/
public function gitlabProject(): \Illuminate\Database\Eloquent\Relations\BelongsTo
public function gitlabProject(): BelongsTo
{
return $this->belongsTo(GitlabProject::class, 'gitlab_project_id');
}

View file

@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Models;
use App\Mails\Auth\LinkResetPasswordMail;
use App\Models\GitlabUser;
use App\Models\UserPassword;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Support\Facades\Mail;
use Uwil\LaravelBackend\Models\User as BackendUser;
@ -18,6 +20,7 @@ use Uwil\LaravelBackend\Models\User as BackendUser;
* User's associated gitlab id.
* @property-read \Illuminate\Database\Eloquent\Collection<int,\App\Models\Site> $sites
* User's associated sites.
*
* @see \Uwil\LaravelBackend\Models\User For all other properties and methods.
*/
class User extends BackendUser
@ -54,15 +57,13 @@ class User extends BackendUser
{
return [
'gitlabUser',
'sites' => fn($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
'sites' => fn ($q) => $q->withoutGlobalScope(SoftDeletingScope::class),
];
}
/**
* Get the password for authentication.
* Retrieves the hashed password from the related user_passwords table.
*
* @return string
*/
#[\Override]
public function getAuthPassword(): string
@ -73,8 +74,8 @@ class User extends BackendUser
/**
* Send the password reset notification to the user.
*
* @param string $token
* @return void
* @param string $token
*
* @phpcs:disable
*/
#[\Override]
@ -82,7 +83,7 @@ class User extends BackendUser
{
// @phpcs:enable
$url = sprintf(
"%s?email=%s",
'%s?email=%s',
url(route(config('uwil-backend.routes.name') . 'reset-password', ['token' => $token], false)),
urlencode($this->getEmailForPasswordReset())
);
@ -97,7 +98,7 @@ class User extends BackendUser
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\UserPassword,$this>
*/
public function userPassword(): \Illuminate\Database\Eloquent\Relations\HasOne
public function userPassword(): HasOne
{
return $this->hasOne(UserPassword::class);
}
@ -107,7 +108,7 @@ class User extends BackendUser
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\GitlabUser,$this>
*/
public function gitlabUser(): \Illuminate\Database\Eloquent\Relations\HasOne
public function gitlabUser(): HasOne
{
return $this->hasOne(GitlabUser::class);
}
@ -117,7 +118,7 @@ class User extends BackendUser
*
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Site,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
*/
public function sites(): \Illuminate\Database\Eloquent\Relations\MorphToMany
public function sites(): MorphToMany
{
return $this->morphToMany(
Site::class,

View file

@ -1,13 +1,15 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id Primary key of the user password.
* @property \App\Models\User $user_id Associated user.
* @property string $password Password of the user.
* @property int $id Primary key of the user password.
* @property \App\Models\User $user_id Associated user.
* @property string $password Password of the user.
* @property-read \Illuminate\Support\Carbon $created_at Date on which the password was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date on which the password was updated.
*/

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Database\Eloquent\Model;
@ -13,9 +15,6 @@ class BrandPolicy
{
/**
* Determine whether the user can view any models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewAny(Model $authModel): bool
{
@ -24,9 +23,6 @@ class BrandPolicy
/**
* Determine whether the user can view trash models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewTrash(Model $authModel): bool
{
@ -35,9 +31,6 @@ class BrandPolicy
/**
* Determine whether the user can view the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function view(Model $authModel): bool
{
@ -46,9 +39,6 @@ class BrandPolicy
/**
* Determine whether the user can create models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function create(Model $authModel): bool
{
@ -57,9 +47,6 @@ class BrandPolicy
/**
* Determine whether the user can update the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function update(Model $authModel): bool
{
@ -68,9 +55,6 @@ class BrandPolicy
/**
* Determine whether the user can duplicate the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function duplicate(Model $authModel): bool
{
@ -79,9 +63,6 @@ class BrandPolicy
/**
* Determine whether the user can restore the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function restore(Model $authModel): bool
{
@ -90,9 +71,6 @@ class BrandPolicy
/**
* Determine whether the user can soft delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function delete(Model $authModel): bool
{
@ -101,9 +79,6 @@ class BrandPolicy
/**
* Determine whether the user can permanently delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function forceDelete(Model $authModel): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Database\Eloquent\Model;
@ -13,9 +15,6 @@ class InvoiceCompanyPolicy
{
/**
* Determine whether the user can view any models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewAny(Model $authModel): bool
{
@ -24,9 +23,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can view trash models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewTrash(Model $authModel): bool
{
@ -35,9 +31,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can view the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function view(Model $authModel): bool
{
@ -46,9 +39,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can create models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function create(Model $authModel): bool
{
@ -57,9 +47,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can update the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function update(Model $authModel): bool
{
@ -68,9 +55,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can duplicate the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function duplicate(Model $authModel): bool
{
@ -79,9 +63,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can restore the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function restore(Model $authModel): bool
{
@ -90,9 +71,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can soft delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function delete(Model $authModel): bool
{
@ -101,9 +79,6 @@ class InvoiceCompanyPolicy
/**
* Determine whether the user can permanently delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function forceDelete(Model $authModel): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Database\Eloquent\Model;
@ -13,9 +15,6 @@ class InvoicePackagePolicy
{
/**
* Determine whether the user can view any models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewAny(Model $authModel): bool
{
@ -24,9 +23,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can view trash models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewTrash(Model $authModel): bool
{
@ -35,9 +31,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can view the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function view(Model $authModel): bool
{
@ -46,9 +39,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can create models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function create(Model $authModel): bool
{
@ -57,9 +47,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can update the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function update(Model $authModel): bool
{
@ -68,9 +55,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can duplicate the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function duplicate(Model $authModel): bool
{
@ -79,9 +63,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can restore the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function restore(Model $authModel): bool
{
@ -90,9 +71,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can soft delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function delete(Model $authModel): bool
{
@ -101,9 +79,6 @@ class InvoicePackagePolicy
/**
* Determine whether the user can permanently delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function forceDelete(Model $authModel): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Database\Eloquent\Model;
@ -13,9 +15,6 @@ class NoticePolicy
{
/**
* Determine whether the user can view any models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewAny(Model $authModel): bool
{
@ -24,9 +23,6 @@ class NoticePolicy
/**
* Determine whether the user can view trash models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewTrash(Model $authModel): bool
{
@ -35,9 +31,6 @@ class NoticePolicy
/**
* Determine whether the user can view the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function view(Model $authModel): bool
{
@ -46,9 +39,6 @@ class NoticePolicy
/**
* Determine whether the user can create models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function create(Model $authModel): bool
{
@ -57,9 +47,6 @@ class NoticePolicy
/**
* Determine whether the user can update the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function update(Model $authModel): bool
{
@ -68,9 +55,6 @@ class NoticePolicy
/**
* Determine whether the user can duplicate the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function duplicate(Model $authModel): bool
{
@ -79,9 +63,6 @@ class NoticePolicy
/**
* Determine whether the user can restore the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function restore(Model $authModel): bool
{
@ -90,9 +71,6 @@ class NoticePolicy
/**
* Determine whether the user can soft delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function delete(Model $authModel): bool
{
@ -101,9 +79,6 @@ class NoticePolicy
/**
* Determine whether the user can permanently delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function forceDelete(Model $authModel): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Database\Eloquent\Model;
@ -13,9 +15,6 @@ class SitePolicy
{
/**
* Determine whether the user can view any models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewAny(Model $authModel): bool
{
@ -24,9 +23,6 @@ class SitePolicy
/**
* Determine whether the user can view trash models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function viewTrash(Model $authModel): bool
{
@ -35,9 +31,6 @@ class SitePolicy
/**
* Determine whether the user can view the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function view(Model $authModel): bool
{
@ -46,9 +39,6 @@ class SitePolicy
/**
* Determine whether the user can create models.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function create(Model $authModel): bool
{
@ -57,9 +47,6 @@ class SitePolicy
/**
* Determine whether the user can update the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function update(Model $authModel): bool
{
@ -68,9 +55,6 @@ class SitePolicy
/**
* Determine whether the user can duplicate the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function duplicate(Model $authModel): bool
{
@ -79,9 +63,6 @@ class SitePolicy
/**
* Determine whether the user can restore the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function restore(Model $authModel): bool
{
@ -90,9 +71,6 @@ class SitePolicy
/**
* Determine whether the user can soft delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function delete(Model $authModel): bool
{
@ -101,9 +79,6 @@ class SitePolicy
/**
* Determine whether the user can permanently delete the model.
*
* @param \Illuminate\Database\Eloquent\Model $authModel
* @return boolean
*/
public function forceDelete(Model $authModel): bool
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use App\Enums\NoticeTypeEnum;
@ -17,8 +19,6 @@ class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(): void
{

View file

@ -1,14 +1,27 @@
<?php
declare(strict_types=1);
use App\Console\Commands\MakeUser;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Uwil\LaravelBackend\Middlewares\Authenticate;
use Uwil\LaravelBackend\Middlewares\LogoutUnpublishedUsers;
use Uwil\LaravelBackend\Middlewares\RedirectIfAuthenticated;
use Uwil\LaravelCommon\Helpers\InertiaHelper;
use Uwil\LaravelCommon\Middlewares\HandleInertiaRequests;
use Uwil\LaravelCommon\Middlewares\SecureHeaders;
use Uwil\LaravelCommon\Middlewares\TrimStrings;
use Uwil\LaravelCommon\Middlewares\TrustHosts;
use Uwil\LaravelCommon\Middlewares\TrustProxies;
use Uwil\LaravelI18n\Middlewares\ForceLocale;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
@ -18,11 +31,11 @@ return Application::configure(basePath: dirname(__DIR__))
Route::middleware(['web', 'throttle:5,2'])
->post('/csp-report', function (): void {
$isCspRequest = request()->header('Content-Type') === 'application/csp-report';
abort_if(!$isCspRequest or !request()->json('csp-report') or !is_array(request()->json('csp-report')), 401);
abort_if(! $isCspRequest or ! request()->json('csp-report') or ! is_array(request()->json('csp-report')), 401);
// * Flatten if needed.
$cspReport = collect(request()->json('csp-report'))
->flatMap(fn($v, $k) => [$k => is_array($v) ? collect($v)->flatten()->implode(', ') : $v])->all();
// * Filter array keys.
->flatMap(fn ($v, $k) => [$k => is_array($v) ? collect($v)->flatten()->implode(', ') : $v])->all();
// * Filter array keys.
$cspReport = collect(array_intersect_key($cspReport, [
'blocked-uri' => '',
'document-uri' => '',
@ -40,32 +53,33 @@ return Application::configure(basePath: dirname(__DIR__))
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->web(append: [
\Uwil\LaravelI18n\Middlewares\ForceLocale::class,
\Uwil\LaravelCommon\Middlewares\HandleInertiaRequests::class,
\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
\Uwil\LaravelCommon\Middlewares\SecureHeaders::class,
\Uwil\LaravelCommon\Middlewares\TrimStrings::class,
\Uwil\LaravelCommon\Middlewares\TrustHosts::class,
\Uwil\LaravelCommon\Middlewares\TrustProxies::class,
\Uwil\LaravelBackend\Middlewares\LogoutUnpublishedUsers::class,
ForceLocale::class,
HandleInertiaRequests::class,
AddLinkHeadersForPreloadedAssets::class,
SecureHeaders::class,
TrimStrings::class,
TrustHosts::class,
TrustProxies::class,
LogoutUnpublishedUsers::class,
]);
$middleware->preventRequestForgery(except: [
'/csp-report',
]);
$middleware->alias([
'auth' => \Uwil\LaravelBackend\Middlewares\Authenticate::class,
'guest' => \Uwil\LaravelBackend\Middlewares\RedirectIfAuthenticated::class,
'auth' => Authenticate::class,
'guest' => RedirectIfAuthenticated::class,
]);
})
->withExceptions(function (Exceptions $exceptions): void {
$exceptions->render(function (HttpException $e, Request $request) {
$status = $e->getStatusCode();
return InertiaHelper::errorRender($request, $status);
});
/**
* Automatic exception capture with Sentry.
*/
$exceptions->report(function (Throwable $e): void {
$exceptions->report(function (\Throwable $e): void {
if (app()->bound('sentry')) {
resolve('sentry')->captureException($e);
}
@ -77,12 +91,13 @@ return Application::configure(basePath: dirname(__DIR__))
$safeInput = collect($request->all())
->except(['password', 'password_confirmation', 'current_password'])
->toArray();
return back()
->withInput($safeInput)
->withErrors($e->errors());
});
})
->withCommands([
\App\Console\Commands\MakeUser::class,
MakeUser::class,
])
->create();

View file

@ -1,8 +1,15 @@
<?php
declare(strict_types=1);
use App\Providers\AppServiceProvider;
use Uwil\K8S\Laravel\K8SServiceProvider;
use Uwil\LaravelCommon\Providers\AppServiceProvider as CommonAppServiceProvider;
use Uwil\LaravelCommon\Providers\TranslationServiceProvider;
return [
Uwil\LaravelCommon\Providers\AppServiceProvider::class,
Uwil\LaravelCommon\Providers\TranslationServiceProvider::class,
Uwil\K8S\Laravel\K8SServiceProvider::class,
App\Providers\AppServiceProvider::class,
CommonAppServiceProvider::class,
TranslationServiceProvider::class,
K8SServiceProvider::class,
AppServiceProvider::class,
];

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
/**
@ -10,9 +12,7 @@ return [
* 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
* other UI elements where an application name needs to be displayed.
*
*/
'name' => env('APP_NAME', 'Laravel'),
/**
@ -23,9 +23,7 @@ return [
* This value determines the "environment" your application is currently
* running in. This may determine how you prefer to configure various
* services the application utilizes. Set this in your ".env" file.
*
*/
'env' => env('APP_ENV', 'production'),
/**
@ -36,9 +34,7 @@ return [
* When your application is in debug mode, detailed error messages with
* stack traces will be shown on every error that occurs within your
* application. If disabled, a simple generic error page is shown.
*
*/
'debug' => (bool) env('APP_DEBUG', false),
/**
@ -49,9 +45,7 @@ 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
* the application so that it's available within Artisan commands.
*
*/
'url' => env('APP_URL', 'http://localhost'),
/**
@ -62,9 +56,7 @@ return [
* Here you may specify the default timezone for your application, which
* 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' => env('APP_TIMEZONE', 'Europe/Paris'),
/**
@ -75,9 +67,7 @@ return [
* The application locale determines the default locale that will be used
* by Laravel's translation / localization methods. This option can be
* set to any locale for which you plan to have translation strings.
*
*/
'locale' => env('APP_LOCALE', 'fr'),
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'fr'),
@ -92,9 +82,7 @@ return [
* 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'),
@ -115,9 +103,7 @@ return [
* allow maintenance mode to be controlled across multiple machines.
*
* Supported drivers: "file", "cache"
*
*/
'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),

View file

@ -1,5 +1,9 @@
<?php
declare(strict_types=1);
use App\Models\User;
return [
/**
@ -10,11 +14,9 @@ return [
* This option defines the default authentication "guard" and password
* reset "broker" for your application. You may change these values
* as required, but they're a perfect start for most applications.
*
*/
'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
@ -32,9 +34,7 @@ return [
* system used by the application. Typically, Eloquent is utilized.
*
* Supported: "session"
*
*/
'guards' => [
'backend' => [
'driver' => 'session',
@ -56,13 +56,11 @@ return [
* be assigned to any extra authentication guards you have defined.
*
* Supported: "database", "eloquent"
*
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
'model' => env('AUTH_MODEL', User::class),
],
],
@ -82,9 +80,7 @@ return [
* The throttle setting is the number of seconds a user must wait before
* generating more password reset tokens. This prevents the user from
* quickly generating a very large amount of password reset tokens.
*
*/
'passwords' => [
'backend' => [
'provider' => 'users',
@ -102,9 +98,7 @@ return [
* Here you may define the amount of seconds before a password confirmation
* window expires and users are asked to re-enter their password via the
* confirmation screen. By default, the timeout lasts for three hours.
*
*/
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
];

View file

@ -1,5 +1,10 @@
<?php
declare(strict_types=1);
use Diglactic\Breadcrumbs\Generator;
use Diglactic\Breadcrumbs\Manager;
return [
/**
@ -20,9 +25,7 @@ return [
* - 'breadcrumbs::uikit' - UIkit
*
* Or a custom view, e.g. '_partials/breadcrumbs'.
*
*/
'view' => null,
/**
@ -34,9 +37,7 @@ return [
*
* - base_path('routes/breadcrumbs.php')
* - glob(base_path('breadcrumbs/*.php'))
*
*/
'files' => array_filter([
...glob(base_path('routes/breadcrumbs/*.php')) ?: [],
]),
@ -47,7 +48,6 @@ return [
*--------------------------------------------------------------------------
*
* Determine when to throw an exception.
*
*/
// * When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException)
@ -65,13 +65,12 @@ return [
*--------------------------------------------------------------------------
*
* Subclass the default classes for more advanced customisations.
*
*/
// * Manager
'manager-class' => Diglactic\Breadcrumbs\Manager::class,
'manager-class' => Manager::class,
// * Generator
'generator-class' => Diglactic\Breadcrumbs\Generator::class,
'generator-class' => Generator::class,
];

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Support\Str;
return [
@ -35,53 +37,53 @@ return [
'stores' => [
'array' => [
'driver' => 'array',
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'driver' => 'database',
'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'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],

View file

@ -1,6 +1,9 @@
<?php
declare(strict_types=1);
use Illuminate\Support\Str;
use Pdo\Mysql;
return [
@ -32,82 +35,82 @@ return [
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'driver' => 'sqlite',
'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',
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
'transaction_mode' => 'DEFERRED',
],
'mysql' => [
'driver' => 'mysql',
'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' => '',
'driver' => 'mysql',
'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'),
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'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' => '',
'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'),
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => env('DB_SSLMODE', 'prefer'),
'search_path' => 'public',
'sslmode' => env('DB_SSLMODE', 'prefer'),
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
],
@ -125,7 +128,7 @@ return [
*/
'migrations' => [
'table' => 'migrations',
'table' => 'migrations',
'update_date_on_publish' => true,
],
@ -145,35 +148,35 @@ return [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')) . '-database-'),
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')) . '-database-'),
'persistent' => env('REDIS_PERSISTENT', false),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
],
],

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
/**
@ -10,9 +12,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 for file storage.
*
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/**
@ -25,39 +25,37 @@ return [
* most supported storage drivers are configured here for reference.
*
* Supported drivers: "local", "ftp", "sftp", "s3"
*
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'serve' => true,
'throw' => false,
'root' => storage_path('app'),
'serve' => true,
'throw' => false,
'report' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage',
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
'throw' => false,
'report' => false,
'throw' => false,
'report' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'report' => false,
'throw' => false,
'report' => false,
],
],
@ -70,9 +68,7 @@ return [
* Here you may configure the symbolic links that will be created when the
* `storage:link` Artisan command is executed. The array keys should be
* the locations of the links and the values should be their targets.
*
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
/**
@ -16,9 +18,7 @@ return [
* Do note that enabling these options will NOT automatically make SSR work,
* as a separate rendering service needs to be available. To learn more,
* please visit https://inertiajs.com/server-side-rendering
*
*/
'ssr' => [
'enabled' => false,
@ -36,9 +36,7 @@ return [
* filesystem. For instance, when using `assertInertia`, the assertion
* attempts to locate the component as a file relative to any of the
* paths AND with any of the extensions specified here.
*
*/
'testing' => [
'ensure_pages_exist' => true,

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
// Uncomment the languages that your site supports - or add new ones.
@ -8,296 +10,296 @@ return [
// Original config here: https://github.com/mcamara/laravel-localization/blob/master/src/config/config.php.
// @phpcs:disable Squiz.Commenting.InlineComment.NoSpaceBefore, Generic.Files.LineLength.TooLong, Squiz.PHP.CommentedOutCode.Found
'supportedLocales' => [
//'ace' => ['name' => 'Achinese', 'script' => 'Latn', 'native' => 'Aceh', 'regional' => ''],
//'af' => ['name' => 'Afrikaans', 'script' => 'Latn', 'native' => 'Afrikaans', 'regional' => 'af_ZA'],
//'agq' => ['name' => 'Aghem', 'script' => 'Latn', 'native' => 'Aghem', 'regional' => ''],
//'ak' => ['name' => 'Akan', 'script' => 'Latn', 'native' => 'Akan', 'regional' => 'ak_GH'],
//'an' => ['name' => 'Aragonese', 'script' => 'Latn', 'native' => 'aragonés', 'regional' => 'an_ES'],
//'cch' => ['name' => 'Atsam', 'script' => 'Latn', 'native' => 'Atsam', 'regional' => ''],
//'gn' => ['name' => 'Guaraní', 'script' => 'Latn', 'native' => 'Avañe’ẽ', 'regional' => ''],
//'ae' => ['name' => 'Avestan', 'script' => 'Latn', 'native' => 'avesta', 'regional' => ''],
//'ay' => ['name' => 'Aymara', 'script' => 'Latn', 'native' => 'aymar aru', 'regional' => 'ay_PE'],
//'az' => ['name' => 'Azerbaijani (Latin)', 'script' => 'Latn', 'native' => 'azərbaycanca', 'regional' => 'az_AZ'],
//'id' => ['name' => 'Indonesian', 'script' => 'Latn', 'native' => 'Bahasa Indonesia', 'regional' => 'id_ID'],
//'ms' => ['name' => 'Malay', 'script' => 'Latn', 'native' => 'Bahasa Melayu', 'regional' => 'ms_MY'],
//'bm' => ['name' => 'Bambara', 'script' => 'Latn', 'native' => 'bamanakan', 'regional' => ''],
//'jv' => ['name' => 'Javanese (Latin)', 'script' => 'Latn', 'native' => 'Basa Jawa', 'regional' => ''],
//'su' => ['name' => 'Sundanese', 'script' => 'Latn', 'native' => 'Basa Sunda', 'regional' => ''],
//'bh' => ['name' => 'Bihari', 'script' => 'Latn', 'native' => 'Bihari', 'regional' => ''],
//'bi' => ['name' => 'Bislama', 'script' => 'Latn', 'native' => 'Bislama', 'regional' => ''],
//'nb' => ['name' => 'Norwegian Bokmål', 'script' => 'Latn', 'native' => 'Bokmål', 'regional' => 'nb_NO'],
//'bs' => ['name' => 'Bosnian', 'script' => 'Latn', 'native' => 'bosanski', 'regional' => 'bs_BA'],
//'br' => ['name' => 'Breton', 'script' => 'Latn', 'native' => 'brezhoneg', 'regional' => 'br_FR'],
//'ca' => ['name' => 'Catalan', 'script' => 'Latn', 'native' => 'català', 'regional' => 'ca_ES'],
//'ch' => ['name' => 'Chamorro', 'script' => 'Latn', 'native' => 'Chamoru', 'regional' => ''],
//'ny' => ['name' => 'Chewa', 'script' => 'Latn', 'native' => 'chiCheŵa', 'regional' => ''],
//'kde' => ['name' => 'Makonde', 'script' => 'Latn', 'native' => 'Chimakonde', 'regional' => ''],
//'sn' => ['name' => 'Shona', 'script' => 'Latn', 'native' => 'chiShona', 'regional' => ''],
//'co' => ['name' => 'Corsican', 'script' => 'Latn', 'native' => 'corsu', 'regional' => ''],
//'cy' => ['name' => 'Welsh', 'script' => 'Latn', 'native' => 'Cymraeg', 'regional' => 'cy_GB'],
//'da' => ['name' => 'Danish', 'script' => 'Latn', 'native' => 'dansk', 'regional' => 'da_DK'],
//'se' => ['name' => 'Northern Sami', 'script' => 'Latn', 'native' => 'davvisámegiella', 'regional' => 'se_NO'],
// 'ace' => ['name' => 'Achinese', 'script' => 'Latn', 'native' => 'Aceh', 'regional' => ''],
// 'af' => ['name' => 'Afrikaans', 'script' => 'Latn', 'native' => 'Afrikaans', 'regional' => 'af_ZA'],
// 'agq' => ['name' => 'Aghem', 'script' => 'Latn', 'native' => 'Aghem', 'regional' => ''],
// 'ak' => ['name' => 'Akan', 'script' => 'Latn', 'native' => 'Akan', 'regional' => 'ak_GH'],
// 'an' => ['name' => 'Aragonese', 'script' => 'Latn', 'native' => 'aragonés', 'regional' => 'an_ES'],
// 'cch' => ['name' => 'Atsam', 'script' => 'Latn', 'native' => 'Atsam', 'regional' => ''],
// 'gn' => ['name' => 'Guaraní', 'script' => 'Latn', 'native' => 'Avañe’ẽ', 'regional' => ''],
// 'ae' => ['name' => 'Avestan', 'script' => 'Latn', 'native' => 'avesta', 'regional' => ''],
// 'ay' => ['name' => 'Aymara', 'script' => 'Latn', 'native' => 'aymar aru', 'regional' => 'ay_PE'],
// 'az' => ['name' => 'Azerbaijani (Latin)', 'script' => 'Latn', 'native' => 'azərbaycanca', 'regional' => 'az_AZ'],
// 'id' => ['name' => 'Indonesian', 'script' => 'Latn', 'native' => 'Bahasa Indonesia', 'regional' => 'id_ID'],
// 'ms' => ['name' => 'Malay', 'script' => 'Latn', 'native' => 'Bahasa Melayu', 'regional' => 'ms_MY'],
// 'bm' => ['name' => 'Bambara', 'script' => 'Latn', 'native' => 'bamanakan', 'regional' => ''],
// 'jv' => ['name' => 'Javanese (Latin)', 'script' => 'Latn', 'native' => 'Basa Jawa', 'regional' => ''],
// 'su' => ['name' => 'Sundanese', 'script' => 'Latn', 'native' => 'Basa Sunda', 'regional' => ''],
// 'bh' => ['name' => 'Bihari', 'script' => 'Latn', 'native' => 'Bihari', 'regional' => ''],
// 'bi' => ['name' => 'Bislama', 'script' => 'Latn', 'native' => 'Bislama', 'regional' => ''],
// 'nb' => ['name' => 'Norwegian Bokmål', 'script' => 'Latn', 'native' => 'Bokmål', 'regional' => 'nb_NO'],
// 'bs' => ['name' => 'Bosnian', 'script' => 'Latn', 'native' => 'bosanski', 'regional' => 'bs_BA'],
// 'br' => ['name' => 'Breton', 'script' => 'Latn', 'native' => 'brezhoneg', 'regional' => 'br_FR'],
// 'ca' => ['name' => 'Catalan', 'script' => 'Latn', 'native' => 'català', 'regional' => 'ca_ES'],
// 'ch' => ['name' => 'Chamorro', 'script' => 'Latn', 'native' => 'Chamoru', 'regional' => ''],
// 'ny' => ['name' => 'Chewa', 'script' => 'Latn', 'native' => 'chiCheŵa', 'regional' => ''],
// 'kde' => ['name' => 'Makonde', 'script' => 'Latn', 'native' => 'Chimakonde', 'regional' => ''],
// 'sn' => ['name' => 'Shona', 'script' => 'Latn', 'native' => 'chiShona', 'regional' => ''],
// 'co' => ['name' => 'Corsican', 'script' => 'Latn', 'native' => 'corsu', 'regional' => ''],
// 'cy' => ['name' => 'Welsh', 'script' => 'Latn', 'native' => 'Cymraeg', 'regional' => 'cy_GB'],
// 'da' => ['name' => 'Danish', 'script' => 'Latn', 'native' => 'dansk', 'regional' => 'da_DK'],
// 'se' => ['name' => 'Northern Sami', 'script' => 'Latn', 'native' => 'davvisámegiella', 'regional' => 'se_NO'],
// 'de' => ['name' => 'German', 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'],
//'luo' => ['name' => 'Luo', 'script' => 'Latn', 'native' => 'Dholuo', 'regional' => ''],
//'nv' => ['name' => 'Navajo', 'script' => 'Latn', 'native' => 'Diné bizaad', 'regional' => ''],
//'dua' => ['name' => 'Duala', 'script' => 'Latn', 'native' => 'duálá', 'regional' => ''],
//'et' => ['name' => 'Estonian', 'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'],
//'na' => ['name' => 'Nauru', 'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''],
//'guz' => ['name' => 'Ekegusii', 'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''],
// 'luo' => ['name' => 'Luo', 'script' => 'Latn', 'native' => 'Dholuo', 'regional' => ''],
// 'nv' => ['name' => 'Navajo', 'script' => 'Latn', 'native' => 'Diné bizaad', 'regional' => ''],
// 'dua' => ['name' => 'Duala', 'script' => 'Latn', 'native' => 'duálá', 'regional' => ''],
// 'et' => ['name' => 'Estonian', 'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'],
// 'na' => ['name' => 'Nauru', 'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''],
// 'guz' => ['name' => 'Ekegusii', 'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''],
// 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'],
//'en-AU' => ['name' => 'Australian English', 'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'],
//'en-GB' => ['name' => 'British English', 'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'],
//'en-CA' => ['name' => 'Canadian English', 'script' => 'Latn', 'native' => 'Canadian English', 'regional' => 'en_CA'],
//'en-US' => ['name' => 'U.S. English', 'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'],
// 'en-AU' => ['name' => 'Australian English', 'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'],
// 'en-GB' => ['name' => 'British English', 'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'],
// 'en-CA' => ['name' => 'Canadian English', 'script' => 'Latn', 'native' => 'Canadian English', 'regional' => 'en_CA'],
// 'en-US' => ['name' => 'U.S. English', 'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'],
// 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'],
//'eo' => ['name' => 'Esperanto', 'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''],
//'eu' => ['name' => 'Basque', 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'],
//'ewo' => ['name' => 'Ewondo', 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''],
//'ee' => ['name' => 'Ewe', 'script' => 'Latn', 'native' => 'eʋegbe', 'regional' => ''],
//'fil' => ['name' => 'Filipino', 'script' => 'Latn', 'native' => 'Filipino', 'regional' => 'fil_PH'],
// 'eo' => ['name' => 'Esperanto', 'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''],
// 'eu' => ['name' => 'Basque', 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'],
// 'ewo' => ['name' => 'Ewondo', 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''],
// 'ee' => ['name' => 'Ewe', 'script' => 'Latn', 'native' => 'eʋegbe', 'regional' => ''],
// 'fil' => ['name' => 'Filipino', 'script' => 'Latn', 'native' => 'Filipino', 'regional' => 'fil_PH'],
'fr' => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'],
//'fr-CA' => ['name' => 'Canadian French', 'script' => 'Latn', 'native' => 'français canadien', 'regional' => 'fr_CA'],
//'fy' => ['name' => 'Western Frisian', 'script' => 'Latn', 'native' => 'frysk', 'regional' => 'fy_DE'],
//'fur' => ['name' => 'Friulian', 'script' => 'Latn', 'native' => 'furlan', 'regional' => 'fur_IT'],
//'fo' => ['name' => 'Faroese', 'script' => 'Latn', 'native' => 'føroyskt', 'regional' => 'fo_FO'],
//'gaa' => ['name' => 'Ga', 'script' => 'Latn', 'native' => 'Ga', 'regional' => ''],
//'ga' => ['name' => 'Irish', 'script' => 'Latn', 'native' => 'Gaeilge', 'regional' => 'ga_IE'],
//'gv' => ['name' => 'Manx', 'script' => 'Latn', 'native' => 'Gaelg', 'regional' => 'gv_GB'],
//'sm' => ['name' => 'Samoan', 'script' => 'Latn', 'native' => 'Gagana fa’a Sāmoa', 'regional' => ''],
//'gl' => ['name' => 'Galician', 'script' => 'Latn', 'native' => 'galego', 'regional' => 'gl_ES'],
//'ki' => ['name' => 'Kikuyu', 'script' => 'Latn', 'native' => 'Gikuyu', 'regional' => ''],
//'gd' => ['name' => 'Scottish Gaelic', 'script' => 'Latn', 'native' => 'Gàidhlig', 'regional' => 'gd_GB'],
//'ha' => ['name' => 'Hausa', 'script' => 'Latn', 'native' => 'Hausa', 'regional' => 'ha_NG'],
//'bez' => ['name' => 'Bena', 'script' => 'Latn', 'native' => 'Hibena', 'regional' => ''],
//'ho' => ['name' => 'Hiri Motu', 'script' => 'Latn', 'native' => 'Hiri Motu', 'regional' => ''],
//'hr' => ['name' => 'Croatian', 'script' => 'Latn', 'native' => 'hrvatski', 'regional' => 'hr_HR'],
//'bem' => ['name' => 'Bemba', 'script' => 'Latn', 'native' => 'Ichibemba', 'regional' => 'bem_ZM'],
//'io' => ['name' => 'Ido', 'script' => 'Latn', 'native' => 'Ido', 'regional' => ''],
//'ig' => ['name' => 'Igbo', 'script' => 'Latn', 'native' => 'Igbo', 'regional' => 'ig_NG'],
//'rn' => ['name' => 'Rundi', 'script' => 'Latn', 'native' => 'Ikirundi', 'regional' => ''],
//'ia' => ['name' => 'Interlingua', 'script' => 'Latn', 'native' => 'interlingua', 'regional' => 'ia_FR'],
//'iu-Latn' => ['name' => 'Inuktitut (Latin)', 'script' => 'Latn', 'native' => 'Inuktitut', 'regional' => 'iu_CA'],
//'sbp' => ['name' => 'Sileibi', 'script' => 'Latn', 'native' => 'Ishisangu', 'regional' => ''],
//'nd' => ['name' => 'North Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => ''],
//'nr' => ['name' => 'South Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => 'nr_ZA'],
//'xh' => ['name' => 'Xhosa', 'script' => 'Latn', 'native' => 'isiXhosa', 'regional' => 'xh_ZA'],
//'zu' => ['name' => 'Zulu', 'script' => 'Latn', 'native' => 'isiZulu', 'regional' => 'zu_ZA'],
//'it' => ['name' => 'Italian', 'script' => 'Latn', 'native' => 'italiano', 'regional' => 'it_IT'],
//'ik' => ['name' => 'Inupiaq', 'script' => 'Latn', 'native' => 'Iñupiaq', 'regional' => 'ik_CA'],
//'dyo' => ['name' => 'Jola-Fonyi', 'script' => 'Latn', 'native' => 'joola', 'regional' => ''],
//'kea' => ['name' => 'Kabuverdianu', 'script' => 'Latn', 'native' => 'kabuverdianu', 'regional' => ''],
//'kaj' => ['name' => 'Jju', 'script' => 'Latn', 'native' => 'Kaje', 'regional' => ''],
//'mh' => ['name' => 'Marshallese', 'script' => 'Latn', 'native' => 'Kajin M̧ajeļ', 'regional' => 'mh_MH'],
//'kl' => ['name' => 'Kalaallisut', 'script' => 'Latn', 'native' => 'kalaallisut', 'regional' => 'kl_GL'],
//'kln' => ['name' => 'Kalenjin', 'script' => 'Latn', 'native' => 'Kalenjin', 'regional' => ''],
//'kr' => ['name' => 'Kanuri', 'script' => 'Latn', 'native' => 'Kanuri', 'regional' => ''],
//'kcg' => ['name' => 'Tyap', 'script' => 'Latn', 'native' => 'Katab', 'regional' => ''],
//'kw' => ['name' => 'Cornish', 'script' => 'Latn', 'native' => 'kernewek', 'regional' => 'kw_GB'],
//'naq' => ['name' => 'Nama', 'script' => 'Latn', 'native' => 'Khoekhoegowab', 'regional' => ''],
//'rof' => ['name' => 'Rombo', 'script' => 'Latn', 'native' => 'Kihorombo', 'regional' => ''],
//'kam' => ['name' => 'Kamba', 'script' => 'Latn', 'native' => 'Kikamba', 'regional' => ''],
//'kg' => ['name' => 'Kongo', 'script' => 'Latn', 'native' => 'Kikongo', 'regional' => ''],
//'jmc' => ['name' => 'Machame', 'script' => 'Latn', 'native' => 'Kimachame', 'regional' => ''],
//'rw' => ['name' => 'Kinyarwanda', 'script' => 'Latn', 'native' => 'Kinyarwanda', 'regional' => 'rw_RW'],
//'asa' => ['name' => 'Kipare', 'script' => 'Latn', 'native' => 'Kipare', 'regional' => ''],
//'rwk' => ['name' => 'Rwa', 'script' => 'Latn', 'native' => 'Kiruwa', 'regional' => ''],
//'saq' => ['name' => 'Samburu', 'script' => 'Latn', 'native' => 'Kisampur', 'regional' => ''],
//'ksb' => ['name' => 'Shambala', 'script' => 'Latn', 'native' => 'Kishambaa', 'regional' => ''],
//'swc' => ['name' => 'Congo Swahili', 'script' => 'Latn', 'native' => 'Kiswahili ya Kongo', 'regional' => ''],
//'sw' => ['name' => 'Swahili', 'script' => 'Latn', 'native' => 'Kiswahili', 'regional' => 'sw_KE'],
//'dav' => ['name' => 'Dawida', 'script' => 'Latn', 'native' => 'Kitaita', 'regional' => ''],
//'teo' => ['name' => 'Teso', 'script' => 'Latn', 'native' => 'Kiteso', 'regional' => ''],
//'khq' => ['name' => 'Koyra Chiini', 'script' => 'Latn', 'native' => 'Koyra ciini', 'regional' => ''],
//'ses' => ['name' => 'Songhay', 'script' => 'Latn', 'native' => 'Koyraboro senni', 'regional' => ''],
//'mfe' => ['name' => 'Morisyen', 'script' => 'Latn', 'native' => 'kreol morisien', 'regional' => ''],
//'ht' => ['name' => 'Haitian', 'script' => 'Latn', 'native' => 'Kreyòl ayisyen', 'regional' => 'ht_HT'],
//'kj' => ['name' => 'Kuanyama', 'script' => 'Latn', 'native' => 'Kwanyama', 'regional' => ''],
//'ksh' => ['name' => 'Kölsch', 'script' => 'Latn', 'native' => 'Kölsch', 'regional' => ''],
//'ebu' => ['name' => 'Kiembu', 'script' => 'Latn', 'native' => 'Kĩembu', 'regional' => ''],
//'mer' => ['name' => 'Kimîîru', 'script' => 'Latn', 'native' => 'Kĩmĩrũ', 'regional' => ''],
//'lag' => ['name' => 'Langi', 'script' => 'Latn', 'native' => 'Kɨlaangi', 'regional' => ''],
//'lah' => ['name' => 'Lahnda', 'script' => 'Latn', 'native' => 'Lahnda', 'regional' => ''],
//'la' => ['name' => 'Latin', 'script' => 'Latn', 'native' => 'latine', 'regional' => ''],
//'lv' => ['name' => 'Latvian', 'script' => 'Latn', 'native' => 'latviešu', 'regional' => 'lv_LV'],
//'to' => ['name' => 'Tongan', 'script' => 'Latn', 'native' => 'lea fakatonga', 'regional' => ''],
//'lt' => ['name' => 'Lithuanian', 'script' => 'Latn', 'native' => 'lietuvių', 'regional' => 'lt_LT'],
//'li' => ['name' => 'Limburgish', 'script' => 'Latn', 'native' => 'Limburgs', 'regional' => 'li_BE'],
//'ln' => ['name' => 'Lingala', 'script' => 'Latn', 'native' => 'lingála', 'regional' => ''],
//'lg' => ['name' => 'Ganda', 'script' => 'Latn', 'native' => 'Luganda', 'regional' => 'lg_UG'],
//'luy' => ['name' => 'Oluluyia', 'script' => 'Latn', 'native' => 'Luluhia', 'regional' => ''],
//'lb' => ['name' => 'Luxembourgish', 'script' => 'Latn', 'native' => 'Lëtzebuergesch', 'regional' => 'lb_LU'],
//'hu' => ['name' => 'Hungarian', 'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'],
//'mgh' => ['name' => 'Makhuwa-Meetto', 'script' => 'Latn', 'native' => 'Makua', 'regional' => ''],
//'mg' => ['name' => 'Malagasy', 'script' => 'Latn', 'native' => 'Malagasy', 'regional' => 'mg_MG'],
//'mt' => ['name' => 'Maltese', 'script' => 'Latn', 'native' => 'Malti', 'regional' => 'mt_MT'],
//'mtr' => ['name' => 'Mewari', 'script' => 'Latn', 'native' => 'Mewari', 'regional' => ''],
//'mua' => ['name' => 'Mundang', 'script' => 'Latn', 'native' => 'Mundang', 'regional' => ''],
//'mi' => ['name' => 'Māori', 'script' => 'Latn', 'native' => 'Māori', 'regional' => 'mi_NZ'],
// 'fr-CA' => ['name' => 'Canadian French', 'script' => 'Latn', 'native' => 'français canadien', 'regional' => 'fr_CA'],
// 'fy' => ['name' => 'Western Frisian', 'script' => 'Latn', 'native' => 'frysk', 'regional' => 'fy_DE'],
// 'fur' => ['name' => 'Friulian', 'script' => 'Latn', 'native' => 'furlan', 'regional' => 'fur_IT'],
// 'fo' => ['name' => 'Faroese', 'script' => 'Latn', 'native' => 'føroyskt', 'regional' => 'fo_FO'],
// 'gaa' => ['name' => 'Ga', 'script' => 'Latn', 'native' => 'Ga', 'regional' => ''],
// 'ga' => ['name' => 'Irish', 'script' => 'Latn', 'native' => 'Gaeilge', 'regional' => 'ga_IE'],
// 'gv' => ['name' => 'Manx', 'script' => 'Latn', 'native' => 'Gaelg', 'regional' => 'gv_GB'],
// 'sm' => ['name' => 'Samoan', 'script' => 'Latn', 'native' => 'Gagana fa’a Sāmoa', 'regional' => ''],
// 'gl' => ['name' => 'Galician', 'script' => 'Latn', 'native' => 'galego', 'regional' => 'gl_ES'],
// 'ki' => ['name' => 'Kikuyu', 'script' => 'Latn', 'native' => 'Gikuyu', 'regional' => ''],
// 'gd' => ['name' => 'Scottish Gaelic', 'script' => 'Latn', 'native' => 'Gàidhlig', 'regional' => 'gd_GB'],
// 'ha' => ['name' => 'Hausa', 'script' => 'Latn', 'native' => 'Hausa', 'regional' => 'ha_NG'],
// 'bez' => ['name' => 'Bena', 'script' => 'Latn', 'native' => 'Hibena', 'regional' => ''],
// 'ho' => ['name' => 'Hiri Motu', 'script' => 'Latn', 'native' => 'Hiri Motu', 'regional' => ''],
// 'hr' => ['name' => 'Croatian', 'script' => 'Latn', 'native' => 'hrvatski', 'regional' => 'hr_HR'],
// 'bem' => ['name' => 'Bemba', 'script' => 'Latn', 'native' => 'Ichibemba', 'regional' => 'bem_ZM'],
// 'io' => ['name' => 'Ido', 'script' => 'Latn', 'native' => 'Ido', 'regional' => ''],
// 'ig' => ['name' => 'Igbo', 'script' => 'Latn', 'native' => 'Igbo', 'regional' => 'ig_NG'],
// 'rn' => ['name' => 'Rundi', 'script' => 'Latn', 'native' => 'Ikirundi', 'regional' => ''],
// 'ia' => ['name' => 'Interlingua', 'script' => 'Latn', 'native' => 'interlingua', 'regional' => 'ia_FR'],
// 'iu-Latn' => ['name' => 'Inuktitut (Latin)', 'script' => 'Latn', 'native' => 'Inuktitut', 'regional' => 'iu_CA'],
// 'sbp' => ['name' => 'Sileibi', 'script' => 'Latn', 'native' => 'Ishisangu', 'regional' => ''],
// 'nd' => ['name' => 'North Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => ''],
// 'nr' => ['name' => 'South Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => 'nr_ZA'],
// 'xh' => ['name' => 'Xhosa', 'script' => 'Latn', 'native' => 'isiXhosa', 'regional' => 'xh_ZA'],
// 'zu' => ['name' => 'Zulu', 'script' => 'Latn', 'native' => 'isiZulu', 'regional' => 'zu_ZA'],
// 'it' => ['name' => 'Italian', 'script' => 'Latn', 'native' => 'italiano', 'regional' => 'it_IT'],
// 'ik' => ['name' => 'Inupiaq', 'script' => 'Latn', 'native' => 'Iñupiaq', 'regional' => 'ik_CA'],
// 'dyo' => ['name' => 'Jola-Fonyi', 'script' => 'Latn', 'native' => 'joola', 'regional' => ''],
// 'kea' => ['name' => 'Kabuverdianu', 'script' => 'Latn', 'native' => 'kabuverdianu', 'regional' => ''],
// 'kaj' => ['name' => 'Jju', 'script' => 'Latn', 'native' => 'Kaje', 'regional' => ''],
// 'mh' => ['name' => 'Marshallese', 'script' => 'Latn', 'native' => 'Kajin M̧ajeļ', 'regional' => 'mh_MH'],
// 'kl' => ['name' => 'Kalaallisut', 'script' => 'Latn', 'native' => 'kalaallisut', 'regional' => 'kl_GL'],
// 'kln' => ['name' => 'Kalenjin', 'script' => 'Latn', 'native' => 'Kalenjin', 'regional' => ''],
// 'kr' => ['name' => 'Kanuri', 'script' => 'Latn', 'native' => 'Kanuri', 'regional' => ''],
// 'kcg' => ['name' => 'Tyap', 'script' => 'Latn', 'native' => 'Katab', 'regional' => ''],
// 'kw' => ['name' => 'Cornish', 'script' => 'Latn', 'native' => 'kernewek', 'regional' => 'kw_GB'],
// 'naq' => ['name' => 'Nama', 'script' => 'Latn', 'native' => 'Khoekhoegowab', 'regional' => ''],
// 'rof' => ['name' => 'Rombo', 'script' => 'Latn', 'native' => 'Kihorombo', 'regional' => ''],
// 'kam' => ['name' => 'Kamba', 'script' => 'Latn', 'native' => 'Kikamba', 'regional' => ''],
// 'kg' => ['name' => 'Kongo', 'script' => 'Latn', 'native' => 'Kikongo', 'regional' => ''],
// 'jmc' => ['name' => 'Machame', 'script' => 'Latn', 'native' => 'Kimachame', 'regional' => ''],
// 'rw' => ['name' => 'Kinyarwanda', 'script' => 'Latn', 'native' => 'Kinyarwanda', 'regional' => 'rw_RW'],
// 'asa' => ['name' => 'Kipare', 'script' => 'Latn', 'native' => 'Kipare', 'regional' => ''],
// 'rwk' => ['name' => 'Rwa', 'script' => 'Latn', 'native' => 'Kiruwa', 'regional' => ''],
// 'saq' => ['name' => 'Samburu', 'script' => 'Latn', 'native' => 'Kisampur', 'regional' => ''],
// 'ksb' => ['name' => 'Shambala', 'script' => 'Latn', 'native' => 'Kishambaa', 'regional' => ''],
// 'swc' => ['name' => 'Congo Swahili', 'script' => 'Latn', 'native' => 'Kiswahili ya Kongo', 'regional' => ''],
// 'sw' => ['name' => 'Swahili', 'script' => 'Latn', 'native' => 'Kiswahili', 'regional' => 'sw_KE'],
// 'dav' => ['name' => 'Dawida', 'script' => 'Latn', 'native' => 'Kitaita', 'regional' => ''],
// 'teo' => ['name' => 'Teso', 'script' => 'Latn', 'native' => 'Kiteso', 'regional' => ''],
// 'khq' => ['name' => 'Koyra Chiini', 'script' => 'Latn', 'native' => 'Koyra ciini', 'regional' => ''],
// 'ses' => ['name' => 'Songhay', 'script' => 'Latn', 'native' => 'Koyraboro senni', 'regional' => ''],
// 'mfe' => ['name' => 'Morisyen', 'script' => 'Latn', 'native' => 'kreol morisien', 'regional' => ''],
// 'ht' => ['name' => 'Haitian', 'script' => 'Latn', 'native' => 'Kreyòl ayisyen', 'regional' => 'ht_HT'],
// 'kj' => ['name' => 'Kuanyama', 'script' => 'Latn', 'native' => 'Kwanyama', 'regional' => ''],
// 'ksh' => ['name' => 'Kölsch', 'script' => 'Latn', 'native' => 'Kölsch', 'regional' => ''],
// 'ebu' => ['name' => 'Kiembu', 'script' => 'Latn', 'native' => 'Kĩembu', 'regional' => ''],
// 'mer' => ['name' => 'Kimîîru', 'script' => 'Latn', 'native' => 'Kĩmĩrũ', 'regional' => ''],
// 'lag' => ['name' => 'Langi', 'script' => 'Latn', 'native' => 'Kɨlaangi', 'regional' => ''],
// 'lah' => ['name' => 'Lahnda', 'script' => 'Latn', 'native' => 'Lahnda', 'regional' => ''],
// 'la' => ['name' => 'Latin', 'script' => 'Latn', 'native' => 'latine', 'regional' => ''],
// 'lv' => ['name' => 'Latvian', 'script' => 'Latn', 'native' => 'latviešu', 'regional' => 'lv_LV'],
// 'to' => ['name' => 'Tongan', 'script' => 'Latn', 'native' => 'lea fakatonga', 'regional' => ''],
// 'lt' => ['name' => 'Lithuanian', 'script' => 'Latn', 'native' => 'lietuvių', 'regional' => 'lt_LT'],
// 'li' => ['name' => 'Limburgish', 'script' => 'Latn', 'native' => 'Limburgs', 'regional' => 'li_BE'],
// 'ln' => ['name' => 'Lingala', 'script' => 'Latn', 'native' => 'lingála', 'regional' => ''],
// 'lg' => ['name' => 'Ganda', 'script' => 'Latn', 'native' => 'Luganda', 'regional' => 'lg_UG'],
// 'luy' => ['name' => 'Oluluyia', 'script' => 'Latn', 'native' => 'Luluhia', 'regional' => ''],
// 'lb' => ['name' => 'Luxembourgish', 'script' => 'Latn', 'native' => 'Lëtzebuergesch', 'regional' => 'lb_LU'],
// 'hu' => ['name' => 'Hungarian', 'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'],
// 'mgh' => ['name' => 'Makhuwa-Meetto', 'script' => 'Latn', 'native' => 'Makua', 'regional' => ''],
// 'mg' => ['name' => 'Malagasy', 'script' => 'Latn', 'native' => 'Malagasy', 'regional' => 'mg_MG'],
// 'mt' => ['name' => 'Maltese', 'script' => 'Latn', 'native' => 'Malti', 'regional' => 'mt_MT'],
// 'mtr' => ['name' => 'Mewari', 'script' => 'Latn', 'native' => 'Mewari', 'regional' => ''],
// 'mua' => ['name' => 'Mundang', 'script' => 'Latn', 'native' => 'Mundang', 'regional' => ''],
// 'mi' => ['name' => 'Māori', 'script' => 'Latn', 'native' => 'Māori', 'regional' => 'mi_NZ'],
// 'nl' => ['name' => 'Dutch', 'script' => 'Latn', 'native' => 'Nederlands', 'regional' => 'nl_NL'],
//'nmg' => ['name' => 'Kwasio', 'script' => 'Latn', 'native' => 'ngumba', 'regional' => ''],
//'yav' => ['name' => 'Yangben', 'script' => 'Latn', 'native' => 'nuasue', 'regional' => ''],
//'nn' => ['name' => 'Norwegian Nynorsk', 'script' => 'Latn', 'native' => 'nynorsk', 'regional' => 'nn_NO'],
//'oc' => ['name' => 'Occitan', 'script' => 'Latn', 'native' => 'occitan', 'regional' => 'oc_FR'],
//'ang' => ['name' => 'Old English', 'script' => 'Runr', 'native' => 'Old English', 'regional' => ''],
//'xog' => ['name' => 'Soga', 'script' => 'Latn', 'native' => 'Olusoga', 'regional' => ''],
//'om' => ['name' => 'Oromo', 'script' => 'Latn', 'native' => 'Oromoo', 'regional' => 'om_ET'],
//'ng' => ['name' => 'Ndonga', 'script' => 'Latn', 'native' => 'OshiNdonga', 'regional' => ''],
//'hz' => ['name' => 'Herero', 'script' => 'Latn', 'native' => 'Otjiherero', 'regional' => ''],
//'uz-Latn' => ['name' => 'Uzbek (Latin)', 'script' => 'Latn', 'native' => 'oʼzbekcha', 'regional' => 'uz_UZ'],
//'nds' => ['name' => 'Low German', 'script' => 'Latn', 'native' => 'Plattdüütsch', 'regional' => 'nds_DE'],
// 'nmg' => ['name' => 'Kwasio', 'script' => 'Latn', 'native' => 'ngumba', 'regional' => ''],
// 'yav' => ['name' => 'Yangben', 'script' => 'Latn', 'native' => 'nuasue', 'regional' => ''],
// 'nn' => ['name' => 'Norwegian Nynorsk', 'script' => 'Latn', 'native' => 'nynorsk', 'regional' => 'nn_NO'],
// 'oc' => ['name' => 'Occitan', 'script' => 'Latn', 'native' => 'occitan', 'regional' => 'oc_FR'],
// 'ang' => ['name' => 'Old English', 'script' => 'Runr', 'native' => 'Old English', 'regional' => ''],
// 'xog' => ['name' => 'Soga', 'script' => 'Latn', 'native' => 'Olusoga', 'regional' => ''],
// 'om' => ['name' => 'Oromo', 'script' => 'Latn', 'native' => 'Oromoo', 'regional' => 'om_ET'],
// 'ng' => ['name' => 'Ndonga', 'script' => 'Latn', 'native' => 'OshiNdonga', 'regional' => ''],
// 'hz' => ['name' => 'Herero', 'script' => 'Latn', 'native' => 'Otjiherero', 'regional' => ''],
// 'uz-Latn' => ['name' => 'Uzbek (Latin)', 'script' => 'Latn', 'native' => 'oʼzbekcha', 'regional' => 'uz_UZ'],
// 'nds' => ['name' => 'Low German', 'script' => 'Latn', 'native' => 'Plattdüütsch', 'regional' => 'nds_DE'],
// 'pl' => ['name' => 'Polish', 'script' => 'Latn', 'native' => 'polski', 'regional' => 'pl_PL'],
//'pt' => ['name' => 'Portuguese', 'script' => 'Latn', 'native' => 'português', 'regional' => 'pt_PT'],
//'pt-BR' => ['name' => 'Brazilian Portuguese', 'script' => 'Latn', 'native' => 'português do Brasil', 'regional' => 'pt_BR'],
//'ff' => ['name' => 'Fulah', 'script' => 'Latn', 'native' => 'Pulaar', 'regional' => 'ff_SN'],
//'pi' => ['name' => 'Pahari-Potwari', 'script' => 'Latn', 'native' => 'Pāli', 'regional' => ''],
//'aa' => ['name' => 'Afar', 'script' => 'Latn', 'native' => 'Qafar', 'regional' => 'aa_ER'],
//'ty' => ['name' => 'Tahitian', 'script' => 'Latn', 'native' => 'Reo Māohi', 'regional' => ''],
//'ksf' => ['name' => 'Bafia', 'script' => 'Latn', 'native' => 'rikpa', 'regional' => ''],
//'ro' => ['name' => 'Romanian', 'script' => 'Latn', 'native' => 'română', 'regional' => 'ro_RO'],
//'cgg' => ['name' => 'Chiga', 'script' => 'Latn', 'native' => 'Rukiga', 'regional' => ''],
//'rm' => ['name' => 'Romansh', 'script' => 'Latn', 'native' => 'rumantsch', 'regional' => ''],
//'qu' => ['name' => 'Quechua', 'script' => 'Latn', 'native' => 'Runa Simi', 'regional' => ''],
//'nyn' => ['name' => 'Nyankole', 'script' => 'Latn', 'native' => 'Runyankore', 'regional' => ''],
//'ssy' => ['name' => 'Saho', 'script' => 'Latn', 'native' => 'Saho', 'regional' => ''],
//'sc' => ['name' => 'Sardinian', 'script' => 'Latn', 'native' => 'sardu', 'regional' => 'sc_IT'],
//'de-CH' => ['name' => 'Swiss High German', 'script' => 'Latn', 'native' => 'Schweizer Hochdeutsch', 'regional' => 'de_CH'],
//'gsw' => ['name' => 'Swiss German', 'script' => 'Latn', 'native' => 'Schwiizertüütsch', 'regional' => ''],
//'trv' => ['name' => 'Taroko', 'script' => 'Latn', 'native' => 'Seediq', 'regional' => ''],
//'seh' => ['name' => 'Sena', 'script' => 'Latn', 'native' => 'sena', 'regional' => ''],
//'nso' => ['name' => 'Northern Sotho', 'script' => 'Latn', 'native' => 'Sesotho sa Leboa', 'regional' => 'nso_ZA'],
//'st' => ['name' => 'Southern Sotho', 'script' => 'Latn', 'native' => 'Sesotho', 'regional' => 'st_ZA'],
//'tn' => ['name' => 'Tswana', 'script' => 'Latn', 'native' => 'Setswana', 'regional' => 'tn_ZA'],
//'sq' => ['name' => 'Albanian', 'script' => 'Latn', 'native' => 'shqip', 'regional' => 'sq_AL'],
//'sid' => ['name' => 'Sidamo', 'script' => 'Latn', 'native' => 'Sidaamu Afo', 'regional' => 'sid_ET'],
//'ss' => ['name' => 'Swati', 'script' => 'Latn', 'native' => 'Siswati', 'regional' => 'ss_ZA'],
//'sk' => ['name' => 'Slovak', 'script' => 'Latn', 'native' => 'slovenčina', 'regional' => 'sk_SK'],
//'sl' => ['name' => 'Slovene', 'script' => 'Latn', 'native' => 'slovenščina', 'regional' => 'sl_SI'],
//'so' => ['name' => 'Somali', 'script' => 'Latn', 'native' => 'Soomaali', 'regional' => 'so_SO'],
//'sr-Latn' => ['name' => 'Serbian (Latin)', 'script' => 'Latn', 'native' => 'Srpski', 'regional' => 'sr_RS'],
//'sh' => ['name' => 'Serbo-Croatian', 'script' => 'Latn', 'native' => 'srpskohrvatski', 'regional' => ''],
//'fi' => ['name' => 'Finnish', 'script' => 'Latn', 'native' => 'suomi', 'regional' => 'fi_FI'],
//'sv' => ['name' => 'Swedish', 'script' => 'Latn', 'native' => 'svenska', 'regional' => 'sv_SE'],
//'sg' => ['name' => 'Sango', 'script' => 'Latn', 'native' => 'Sängö', 'regional' => ''],
//'tl' => ['name' => 'Tagalog', 'script' => 'Latn', 'native' => 'Tagalog', 'regional' => 'tl_PH'],
//'tzm-Latn' => ['name' => 'Central Atlas Tamazight (Latin)', 'script' => 'Latn', 'native' => 'Tamazight', 'regional' => ''],
//'kab' => ['name' => 'Kabyle', 'script' => 'Latn', 'native' => 'Taqbaylit', 'regional' => 'kab_DZ'],
//'twq' => ['name' => 'Tasawaq', 'script' => 'Latn', 'native' => 'Tasawaq senni', 'regional' => ''],
//'shi' => ['name' => 'Tachelhit (Latin)', 'script' => 'Latn', 'native' => 'Tashelhit', 'regional' => ''],
//'nus' => ['name' => 'Nuer', 'script' => 'Latn', 'native' => 'Thok Nath', 'regional' => ''],
//'vi' => ['name' => 'Vietnamese', 'script' => 'Latn', 'native' => 'Tiếng Việt', 'regional' => 'vi_VN'],
//'tg-Latn' => ['name' => 'Tajik (Latin)', 'script' => 'Latn', 'native' => 'tojikī', 'regional' => 'tg_TJ'],
//'lu' => ['name' => 'Luba-Katanga', 'script' => 'Latn', 'native' => 'Tshiluba', 'regional' => 've_ZA'],
//'ve' => ['name' => 'Venda', 'script' => 'Latn', 'native' => 'Tshivenḓa', 'regional' => ''],
//'tw' => ['name' => 'Twi', 'script' => 'Latn', 'native' => 'Twi', 'regional' => ''],
//'tr' => ['name' => 'Turkish', 'script' => 'Latn', 'native' => 'Türkçe', 'regional' => 'tr_TR'],
//'ale' => ['name' => 'Aleut', 'script' => 'Latn', 'native' => 'Unangax tunuu', 'regional' => ''],
//'ca-valencia' => ['name' => 'Valencian', 'script' => 'Latn', 'native' => 'valencià', 'regional' => ''],
//'vai-Latn' => ['name' => 'Vai (Latin)', 'script' => 'Latn', 'native' => 'Viyamíĩ', 'regional' => ''],
//'vo' => ['name' => 'Volapük', 'script' => 'Latn', 'native' => 'Volapük', 'regional' => ''],
//'fj' => ['name' => 'Fijian', 'script' => 'Latn', 'native' => 'vosa Vakaviti', 'regional' => ''],
//'wa' => ['name' => 'Walloon', 'script' => 'Latn', 'native' => 'Walon', 'regional' => 'wa_BE'],
//'wae' => ['name' => 'Walser', 'script' => 'Latn', 'native' => 'Walser', 'regional' => 'wae_CH'],
//'wen' => ['name' => 'Sorbian', 'script' => 'Latn', 'native' => 'Wendic', 'regional' => ''],
//'wo' => ['name' => 'Wolof', 'script' => 'Latn', 'native' => 'Wolof', 'regional' => 'wo_SN'],
//'ts' => ['name' => 'Tsonga', 'script' => 'Latn', 'native' => 'Xitsonga', 'regional' => 'ts_ZA'],
//'dje' => ['name' => 'Zarma', 'script' => 'Latn', 'native' => 'Zarmaciine', 'regional' => ''],
//'yo' => ['name' => 'Yoruba', 'script' => 'Latn', 'native' => 'Èdè Yorùbá', 'regional' => 'yo_NG'],
// 'pt' => ['name' => 'Portuguese', 'script' => 'Latn', 'native' => 'português', 'regional' => 'pt_PT'],
// 'pt-BR' => ['name' => 'Brazilian Portuguese', 'script' => 'Latn', 'native' => 'português do Brasil', 'regional' => 'pt_BR'],
// 'ff' => ['name' => 'Fulah', 'script' => 'Latn', 'native' => 'Pulaar', 'regional' => 'ff_SN'],
// 'pi' => ['name' => 'Pahari-Potwari', 'script' => 'Latn', 'native' => 'Pāli', 'regional' => ''],
// 'aa' => ['name' => 'Afar', 'script' => 'Latn', 'native' => 'Qafar', 'regional' => 'aa_ER'],
// 'ty' => ['name' => 'Tahitian', 'script' => 'Latn', 'native' => 'Reo Māohi', 'regional' => ''],
// 'ksf' => ['name' => 'Bafia', 'script' => 'Latn', 'native' => 'rikpa', 'regional' => ''],
// 'ro' => ['name' => 'Romanian', 'script' => 'Latn', 'native' => 'română', 'regional' => 'ro_RO'],
// 'cgg' => ['name' => 'Chiga', 'script' => 'Latn', 'native' => 'Rukiga', 'regional' => ''],
// 'rm' => ['name' => 'Romansh', 'script' => 'Latn', 'native' => 'rumantsch', 'regional' => ''],
// 'qu' => ['name' => 'Quechua', 'script' => 'Latn', 'native' => 'Runa Simi', 'regional' => ''],
// 'nyn' => ['name' => 'Nyankole', 'script' => 'Latn', 'native' => 'Runyankore', 'regional' => ''],
// 'ssy' => ['name' => 'Saho', 'script' => 'Latn', 'native' => 'Saho', 'regional' => ''],
// 'sc' => ['name' => 'Sardinian', 'script' => 'Latn', 'native' => 'sardu', 'regional' => 'sc_IT'],
// 'de-CH' => ['name' => 'Swiss High German', 'script' => 'Latn', 'native' => 'Schweizer Hochdeutsch', 'regional' => 'de_CH'],
// 'gsw' => ['name' => 'Swiss German', 'script' => 'Latn', 'native' => 'Schwiizertüütsch', 'regional' => ''],
// 'trv' => ['name' => 'Taroko', 'script' => 'Latn', 'native' => 'Seediq', 'regional' => ''],
// 'seh' => ['name' => 'Sena', 'script' => 'Latn', 'native' => 'sena', 'regional' => ''],
// 'nso' => ['name' => 'Northern Sotho', 'script' => 'Latn', 'native' => 'Sesotho sa Leboa', 'regional' => 'nso_ZA'],
// 'st' => ['name' => 'Southern Sotho', 'script' => 'Latn', 'native' => 'Sesotho', 'regional' => 'st_ZA'],
// 'tn' => ['name' => 'Tswana', 'script' => 'Latn', 'native' => 'Setswana', 'regional' => 'tn_ZA'],
// 'sq' => ['name' => 'Albanian', 'script' => 'Latn', 'native' => 'shqip', 'regional' => 'sq_AL'],
// 'sid' => ['name' => 'Sidamo', 'script' => 'Latn', 'native' => 'Sidaamu Afo', 'regional' => 'sid_ET'],
// 'ss' => ['name' => 'Swati', 'script' => 'Latn', 'native' => 'Siswati', 'regional' => 'ss_ZA'],
// 'sk' => ['name' => 'Slovak', 'script' => 'Latn', 'native' => 'slovenčina', 'regional' => 'sk_SK'],
// 'sl' => ['name' => 'Slovene', 'script' => 'Latn', 'native' => 'slovenščina', 'regional' => 'sl_SI'],
// 'so' => ['name' => 'Somali', 'script' => 'Latn', 'native' => 'Soomaali', 'regional' => 'so_SO'],
// 'sr-Latn' => ['name' => 'Serbian (Latin)', 'script' => 'Latn', 'native' => 'Srpski', 'regional' => 'sr_RS'],
// 'sh' => ['name' => 'Serbo-Croatian', 'script' => 'Latn', 'native' => 'srpskohrvatski', 'regional' => ''],
// 'fi' => ['name' => 'Finnish', 'script' => 'Latn', 'native' => 'suomi', 'regional' => 'fi_FI'],
// 'sv' => ['name' => 'Swedish', 'script' => 'Latn', 'native' => 'svenska', 'regional' => 'sv_SE'],
// 'sg' => ['name' => 'Sango', 'script' => 'Latn', 'native' => 'Sängö', 'regional' => ''],
// 'tl' => ['name' => 'Tagalog', 'script' => 'Latn', 'native' => 'Tagalog', 'regional' => 'tl_PH'],
// 'tzm-Latn' => ['name' => 'Central Atlas Tamazight (Latin)', 'script' => 'Latn', 'native' => 'Tamazight', 'regional' => ''],
// 'kab' => ['name' => 'Kabyle', 'script' => 'Latn', 'native' => 'Taqbaylit', 'regional' => 'kab_DZ'],
// 'twq' => ['name' => 'Tasawaq', 'script' => 'Latn', 'native' => 'Tasawaq senni', 'regional' => ''],
// 'shi' => ['name' => 'Tachelhit (Latin)', 'script' => 'Latn', 'native' => 'Tashelhit', 'regional' => ''],
// 'nus' => ['name' => 'Nuer', 'script' => 'Latn', 'native' => 'Thok Nath', 'regional' => ''],
// 'vi' => ['name' => 'Vietnamese', 'script' => 'Latn', 'native' => 'Tiếng Việt', 'regional' => 'vi_VN'],
// 'tg-Latn' => ['name' => 'Tajik (Latin)', 'script' => 'Latn', 'native' => 'tojikī', 'regional' => 'tg_TJ'],
// 'lu' => ['name' => 'Luba-Katanga', 'script' => 'Latn', 'native' => 'Tshiluba', 'regional' => 've_ZA'],
// 've' => ['name' => 'Venda', 'script' => 'Latn', 'native' => 'Tshivenḓa', 'regional' => ''],
// 'tw' => ['name' => 'Twi', 'script' => 'Latn', 'native' => 'Twi', 'regional' => ''],
// 'tr' => ['name' => 'Turkish', 'script' => 'Latn', 'native' => 'Türkçe', 'regional' => 'tr_TR'],
// 'ale' => ['name' => 'Aleut', 'script' => 'Latn', 'native' => 'Unangax tunuu', 'regional' => ''],
// 'ca-valencia' => ['name' => 'Valencian', 'script' => 'Latn', 'native' => 'valencià', 'regional' => ''],
// 'vai-Latn' => ['name' => 'Vai (Latin)', 'script' => 'Latn', 'native' => 'Viyamíĩ', 'regional' => ''],
// 'vo' => ['name' => 'Volapük', 'script' => 'Latn', 'native' => 'Volapük', 'regional' => ''],
// 'fj' => ['name' => 'Fijian', 'script' => 'Latn', 'native' => 'vosa Vakaviti', 'regional' => ''],
// 'wa' => ['name' => 'Walloon', 'script' => 'Latn', 'native' => 'Walon', 'regional' => 'wa_BE'],
// 'wae' => ['name' => 'Walser', 'script' => 'Latn', 'native' => 'Walser', 'regional' => 'wae_CH'],
// 'wen' => ['name' => 'Sorbian', 'script' => 'Latn', 'native' => 'Wendic', 'regional' => ''],
// 'wo' => ['name' => 'Wolof', 'script' => 'Latn', 'native' => 'Wolof', 'regional' => 'wo_SN'],
// 'ts' => ['name' => 'Tsonga', 'script' => 'Latn', 'native' => 'Xitsonga', 'regional' => 'ts_ZA'],
// 'dje' => ['name' => 'Zarma', 'script' => 'Latn', 'native' => 'Zarmaciine', 'regional' => ''],
// 'yo' => ['name' => 'Yoruba', 'script' => 'Latn', 'native' => 'Èdè Yorùbá', 'regional' => 'yo_NG'],
// 'de-AT' => ['name' => 'Austrian German', 'script' => 'Latn', 'native' => 'Österreichisches Deutsch', 'regional' => 'de_AT'],
//'is' => ['name' => 'Icelandic', 'script' => 'Latn', 'native' => 'íslenska', 'regional' => 'is_IS'],
//'cs' => ['name' => 'Czech', 'script' => 'Latn', 'native' => 'čeština', 'regional' => 'cs_CZ'],
//'bas' => ['name' => 'Basa', 'script' => 'Latn', 'native' => 'Ɓàsàa', 'regional' => ''],
//'mas' => ['name' => 'Masai', 'script' => 'Latn', 'native' => 'ɔl-Maa', 'regional' => ''],
//'haw' => ['name' => 'Hawaiian', 'script' => 'Latn', 'native' => 'ʻŌlelo Hawaiʻi', 'regional' => ''],
//'el' => ['name' => 'Greek', 'script' => 'Grek', 'native' => 'Ελληνικά', 'regional' => 'el_GR'],
//'uz' => ['name' => 'Uzbek (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Ўзбек', 'regional' => 'uz_UZ'],
//'az-Cyrl' => ['name' => 'Azerbaijani (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Азәрбајҹан', 'regional' => 'uz_UZ'],
//'ab' => ['name' => 'Abkhazian', 'script' => 'Cyrl', 'native' => 'Аҧсуа', 'regional' => ''],
//'os' => ['name' => 'Ossetic', 'script' => 'Cyrl', 'native' => 'Ирон', 'regional' => 'os_RU'],
//'ky' => ['name' => 'Kyrgyz', 'script' => 'Cyrl', 'native' => 'Кыргыз', 'regional' => 'ky_KG'],
//'sr' => ['name' => 'Serbian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Српски', 'regional' => 'sr_RS'],
//'av' => ['name' => 'Avaric', 'script' => 'Cyrl', 'native' => 'авар мацӀ', 'regional' => ''],
//'ady' => ['name' => 'Adyghe', 'script' => 'Cyrl', 'native' => 'адыгэбзэ', 'regional' => ''],
//'ba' => ['name' => 'Bashkir', 'script' => 'Cyrl', 'native' => 'башҡорт теле', 'regional' => ''],
//'be' => ['name' => 'Belarusian', 'script' => 'Cyrl', 'native' => 'беларуская', 'regional' => 'be_BY'],
//'bg' => ['name' => 'Bulgarian', 'script' => 'Cyrl', 'native' => 'български', 'regional' => 'bg_BG'],
//'kv' => ['name' => 'Komi', 'script' => 'Cyrl', 'native' => 'коми кыв', 'regional' => ''],
//'mk' => ['name' => 'Macedonian', 'script' => 'Cyrl', 'native' => 'македонски', 'regional' => 'mk_MK'],
//'mn' => ['name' => 'Mongolian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'монгол', 'regional' => 'mn_MN'],
//'ce' => ['name' => 'Chechen', 'script' => 'Cyrl', 'native' => 'нохчийн мотт', 'regional' => 'ce_RU'],
//'ru' => ['name' => 'Russian', 'script' => 'Cyrl', 'native' => 'русский', 'regional' => 'ru_RU'],
//'sah' => ['name' => 'Yakut', 'script' => 'Cyrl', 'native' => 'саха тыла', 'regional' => ''],
//'tt' => ['name' => 'Tatar', 'script' => 'Cyrl', 'native' => 'татар теле', 'regional' => 'tt_RU'],
//'tg' => ['name' => 'Tajik (Cyrillic)', 'script' => 'Cyrl', 'native' => 'тоҷикӣ', 'regional' => 'tg_TJ'],
//'tk' => ['name' => 'Turkmen', 'script' => 'Cyrl', 'native' => 'түркменче', 'regional' => 'tk_TM'],
//'uk' => ['name' => 'Ukrainian', 'script' => 'Cyrl', 'native' => 'українська', 'regional' => 'uk_UA'],
//'cv' => ['name' => 'Chuvash', 'script' => 'Cyrl', 'native' => 'чӑваш чӗлхи', 'regional' => 'cv_RU'],
//'cu' => ['name' => 'Church Slavic', 'script' => 'Cyrl', 'native' => 'ѩзыкъ словѣньскъ', 'regional' => ''],
//'kk' => ['name' => 'Kazakh', 'script' => 'Cyrl', 'native' => 'қазақ тілі', 'regional' => 'kk_KZ'],
//'hy' => ['name' => 'Armenian', 'script' => 'Armn', 'native' => 'Հայերեն', 'regional' => 'hy_AM'],
//'yi' => ['name' => 'Yiddish', 'script' => 'Hebr', 'native' => 'ייִדיש', 'regional' => 'yi_US'],
//'he' => ['name' => 'Hebrew', 'script' => 'Hebr', 'native' => 'עברית', 'regional' => 'he_IL'],
//'ug' => ['name' => 'Uyghur', 'script' => 'Arab', 'native' => 'ئۇيغۇرچە', 'regional' => 'ug_CN'],
//'ur' => ['name' => 'Urdu', 'script' => 'Arab', 'native' => 'اردو', 'regional' => 'ur_PK'],
//'ar' => ['name' => 'Arabic', 'script' => 'Arab', 'native' => 'العربية', 'regional' => 'ar_AE'],
//'uz-Arab' => ['name' => 'Uzbek (Arabic)', 'script' => 'Arab', 'native' => 'اۉزبېک', 'regional' => ''],
//'tg-Arab' => ['name' => 'Tajik (Arabic)', 'script' => 'Arab', 'native' => 'تاجیکی', 'regional' => 'tg_TJ'],
//'sd' => ['name' => 'Sindhi', 'script' => 'Arab', 'native' => 'سنڌي', 'regional' => 'sd_IN'],
//'fa' => ['name' => 'Persian', 'script' => 'Arab', 'native' => 'فارسی', 'regional' => 'fa_IR'],
//'pa-Arab' => ['name' => 'Punjabi (Arabic)', 'script' => 'Arab', 'native' => 'پنجاب', 'regional' => 'pa_IN'],
//'ps' => ['name' => 'Pashto', 'script' => 'Arab', 'native' => 'پښتو', 'regional' => 'ps_AF'],
//'ks' => ['name' => 'Kashmiri (Arabic)', 'script' => 'Arab', 'native' => 'کأشُر', 'regional' => 'ks_IN'],
//'ku' => ['name' => 'Kurdish', 'script' => 'Arab', 'native' => 'کوردی', 'regional' => 'ku_TR'],
//'dv' => ['name' => 'Divehi', 'script' => 'Thaa', 'native' => 'ދިވެހިބަސް', 'regional' => 'dv_MV'],
//'ks-Deva' => ['name' => 'Kashmiri (Devaganari)', 'script' => 'Deva', 'native' => 'कॉशुर', 'regional' => 'ks_IN'],
//'kok' => ['name' => 'Konkani', 'script' => 'Deva', 'native' => 'कोंकणी', 'regional' => 'kok_IN'],
//'doi' => ['name' => 'Dogri', 'script' => 'Deva', 'native' => 'डोगरी', 'regional' => 'doi_IN'],
//'ne' => ['name' => 'Nepali', 'script' => 'Deva', 'native' => 'नेपाली', 'regional' => ''],
//'pra' => ['name' => 'Prakrit', 'script' => 'Deva', 'native' => 'प्राकृत', 'regional' => ''],
//'brx' => ['name' => 'Bodo', 'script' => 'Deva', 'native' => 'बड़ो', 'regional' => 'brx_IN'],
//'bra' => ['name' => 'Braj', 'script' => 'Deva', 'native' => 'ब्रज भाषा', 'regional' => ''],
//'mr' => ['name' => 'Marathi', 'script' => 'Deva', 'native' => 'मराठी', 'regional' => 'mr_IN'],
//'mai' => ['name' => 'Maithili', 'script' => 'Tirh', 'native' => 'मैथिली', 'regional' => 'mai_IN'],
//'raj' => ['name' => 'Rajasthani', 'script' => 'Deva', 'native' => 'राजस्थानी', 'regional' => ''],
//'sa' => ['name' => 'Sanskrit', 'script' => 'Deva', 'native' => 'संस्कृतम्', 'regional' => 'sa_IN'],
//'hi' => ['name' => 'Hindi', 'script' => 'Deva', 'native' => 'हिन्दी', 'regional' => 'hi_IN'],
//'as' => ['name' => 'Assamese', 'script' => 'Beng', 'native' => 'অসমীয়া', 'regional' => 'as_IN'],
//'bn' => ['name' => 'Bengali', 'script' => 'Beng', 'native' => 'বাংলা', 'regional' => 'bn_BD'],
//'mni' => ['name' => 'Manipuri', 'script' => 'Beng', 'native' => 'মৈতৈ', 'regional' => 'mni_IN'],
//'pa' => ['name' => 'Punjabi (Gurmukhi)', 'script' => 'Guru', 'native' => 'ਪੰਜਾਬੀ', 'regional' => 'pa_IN'],
//'gu' => ['name' => 'Gujarati', 'script' => 'Gujr', 'native' => 'ગુજરાતી', 'regional' => 'gu_IN'],
//'or' => ['name' => 'Oriya', 'script' => 'Orya', 'native' => 'ଓଡ଼ିଆ', 'regional' => 'or_IN'],
//'ta' => ['name' => 'Tamil', 'script' => 'Taml', 'native' => 'தமிழ்', 'regional' => 'ta_IN'],
//'te' => ['name' => 'Telugu', 'script' => 'Telu', 'native' => 'తెలుగు', 'regional' => 'te_IN'],
//'kn' => ['name' => 'Kannada', 'script' => 'Knda', 'native' => 'ಕನ್ನಡ', 'regional' => 'kn_IN'],
//'ml' => ['name' => 'Malayalam', 'script' => 'Mlym', 'native' => 'മലയാളം', 'regional' => 'ml_IN'],
//'si' => ['name' => 'Sinhala', 'script' => 'Sinh', 'native' => 'සිංහල', 'regional' => 'si_LK'],
//'th' => ['name' => 'Thai', 'script' => 'Thai', 'native' => 'ไทย', 'regional' => 'th_TH'],
//'lo' => ['name' => 'Lao', 'script' => 'Laoo', 'native' => 'ລາວ', 'regional' => 'lo_LA'],
//'bo' => ['name' => 'Tibetan', 'script' => 'Tibt', 'native' => 'པོད་སྐད་', 'regional' => 'bo_IN'],
//'dz' => ['name' => 'Dzongkha', 'script' => 'Tibt', 'native' => 'རྫོང་ཁ', 'regional' => 'dz_BT'],
//'my' => ['name' => 'Burmese', 'script' => 'Mymr', 'native' => 'မြန်မာဘာသာ', 'regional' => 'my_MM'],
//'ka' => ['name' => 'Georgian', 'script' => 'Geor', 'native' => 'ქართული', 'regional' => 'ka_GE'],
//'byn' => ['name' => 'Blin', 'script' => 'Ethi', 'native' => 'ብሊን', 'regional' => 'byn_ER'],
//'tig' => ['name' => 'Tigre', 'script' => 'Ethi', 'native' => 'ትግረ', 'regional' => 'tig_ER'],
//'ti' => ['name' => 'Tigrinya', 'script' => 'Ethi', 'native' => 'ትግርኛ', 'regional' => 'ti_ET'],
//'am' => ['name' => 'Amharic', 'script' => 'Ethi', 'native' => 'አማርኛ', 'regional' => 'am_ET'],
//'wal' => ['name' => 'Wolaytta', 'script' => 'Ethi', 'native' => 'ወላይታቱ', 'regional' => 'wal_ET'],
//'chr' => ['name' => 'Cherokee', 'script' => 'Cher', 'native' => 'ᏣᎳᎩ', 'regional' => ''],
//'iu' => ['name' => 'Inuktitut (Canadian Aboriginal Syllabics)', 'script' => 'Cans', 'native' => 'ᐃᓄᒃᑎᑐᑦ', 'regional' => 'iu_CA'],
//'oj' => ['name' => 'Ojibwa', 'script' => 'Cans', 'native' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'regional' => ''],
//'cr' => ['name' => 'Cree', 'script' => 'Cans', 'native' => 'ᓀᐦᐃᔭᐍᐏᐣ', 'regional' => ''],
//'km' => ['name' => 'Khmer', 'script' => 'Khmr', 'native' => 'ភាសាខ្មែរ', 'regional' => 'km_KH'],
//'mn-Mong' => ['name' => 'Mongolian (Mongolian)', 'script' => 'Mong', 'native' => 'ᠮᠣᠨᠭᠭᠣᠯ ᠬᠡᠯᠡ', 'regional' => 'mn_MN'],
//'shi-Tfng' => ['name' => 'Tachelhit (Tifinagh)', 'script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
//'tzm' => ['name' => 'Central Atlas Tamazight (Tifinagh)','script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
//'yue' => ['name' => 'Yue', 'script' => 'Hant', 'native' => '廣州話', 'regional' => 'yue_HK'],
//'ja' => ['name' => 'Japanese', 'script' => 'Jpan', 'native' => '日本語', 'regional' => 'ja_JP'],
//'zh' => ['name' => 'Chinese (Simplified)', 'script' => 'Hans', 'native' => '简体中文', 'regional' => 'zh_CN'],
//'zh-Hant' => ['name' => 'Chinese (Traditional)', 'script' => 'Hant', 'native' => '繁體中文', 'regional' => 'zh_CN'],
//'ii' => ['name' => 'Sichuan Yi', 'script' => 'Yiii', 'native' => 'ꆈꌠꉙ', 'regional' => ''],
//'vai' => ['name' => 'Vai (Vai)', 'script' => 'Vaii', 'native' => 'ꕙꔤ', 'regional' => ''],
//'jv-Java' => ['name' => 'Javanese (Javanese)', 'script' => 'Java', 'native' => 'ꦧꦱꦗꦮ', 'regional' => ''],
//'ko' => ['name' => 'Korean', 'script' => 'Hang', 'native' => '한국어', 'regional' => 'ko_KR'],
// 'is' => ['name' => 'Icelandic', 'script' => 'Latn', 'native' => 'íslenska', 'regional' => 'is_IS'],
// 'cs' => ['name' => 'Czech', 'script' => 'Latn', 'native' => 'čeština', 'regional' => 'cs_CZ'],
// 'bas' => ['name' => 'Basa', 'script' => 'Latn', 'native' => 'Ɓàsàa', 'regional' => ''],
// 'mas' => ['name' => 'Masai', 'script' => 'Latn', 'native' => 'ɔl-Maa', 'regional' => ''],
// 'haw' => ['name' => 'Hawaiian', 'script' => 'Latn', 'native' => 'ʻŌlelo Hawaiʻi', 'regional' => ''],
// 'el' => ['name' => 'Greek', 'script' => 'Grek', 'native' => 'Ελληνικά', 'regional' => 'el_GR'],
// 'uz' => ['name' => 'Uzbek (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Ўзбек', 'regional' => 'uz_UZ'],
// 'az-Cyrl' => ['name' => 'Azerbaijani (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Азәрбајҹан', 'regional' => 'uz_UZ'],
// 'ab' => ['name' => 'Abkhazian', 'script' => 'Cyrl', 'native' => 'Аҧсуа', 'regional' => ''],
// 'os' => ['name' => 'Ossetic', 'script' => 'Cyrl', 'native' => 'Ирон', 'regional' => 'os_RU'],
// 'ky' => ['name' => 'Kyrgyz', 'script' => 'Cyrl', 'native' => 'Кыргыз', 'regional' => 'ky_KG'],
// 'sr' => ['name' => 'Serbian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Српски', 'regional' => 'sr_RS'],
// 'av' => ['name' => 'Avaric', 'script' => 'Cyrl', 'native' => 'авар мацӀ', 'regional' => ''],
// 'ady' => ['name' => 'Adyghe', 'script' => 'Cyrl', 'native' => 'адыгэбзэ', 'regional' => ''],
// 'ba' => ['name' => 'Bashkir', 'script' => 'Cyrl', 'native' => 'башҡорт теле', 'regional' => ''],
// 'be' => ['name' => 'Belarusian', 'script' => 'Cyrl', 'native' => 'беларуская', 'regional' => 'be_BY'],
// 'bg' => ['name' => 'Bulgarian', 'script' => 'Cyrl', 'native' => 'български', 'regional' => 'bg_BG'],
// 'kv' => ['name' => 'Komi', 'script' => 'Cyrl', 'native' => 'коми кыв', 'regional' => ''],
// 'mk' => ['name' => 'Macedonian', 'script' => 'Cyrl', 'native' => 'македонски', 'regional' => 'mk_MK'],
// 'mn' => ['name' => 'Mongolian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'монгол', 'regional' => 'mn_MN'],
// 'ce' => ['name' => 'Chechen', 'script' => 'Cyrl', 'native' => 'нохчийн мотт', 'regional' => 'ce_RU'],
// 'ru' => ['name' => 'Russian', 'script' => 'Cyrl', 'native' => 'русский', 'regional' => 'ru_RU'],
// 'sah' => ['name' => 'Yakut', 'script' => 'Cyrl', 'native' => 'саха тыла', 'regional' => ''],
// 'tt' => ['name' => 'Tatar', 'script' => 'Cyrl', 'native' => 'татар теле', 'regional' => 'tt_RU'],
// 'tg' => ['name' => 'Tajik (Cyrillic)', 'script' => 'Cyrl', 'native' => 'тоҷикӣ', 'regional' => 'tg_TJ'],
// 'tk' => ['name' => 'Turkmen', 'script' => 'Cyrl', 'native' => 'түркменче', 'regional' => 'tk_TM'],
// 'uk' => ['name' => 'Ukrainian', 'script' => 'Cyrl', 'native' => 'українська', 'regional' => 'uk_UA'],
// 'cv' => ['name' => 'Chuvash', 'script' => 'Cyrl', 'native' => 'чӑваш чӗлхи', 'regional' => 'cv_RU'],
// 'cu' => ['name' => 'Church Slavic', 'script' => 'Cyrl', 'native' => 'ѩзыкъ словѣньскъ', 'regional' => ''],
// 'kk' => ['name' => 'Kazakh', 'script' => 'Cyrl', 'native' => 'қазақ тілі', 'regional' => 'kk_KZ'],
// 'hy' => ['name' => 'Armenian', 'script' => 'Armn', 'native' => 'Հայերեն', 'regional' => 'hy_AM'],
// 'yi' => ['name' => 'Yiddish', 'script' => 'Hebr', 'native' => 'ייִדיש', 'regional' => 'yi_US'],
// 'he' => ['name' => 'Hebrew', 'script' => 'Hebr', 'native' => 'עברית', 'regional' => 'he_IL'],
// 'ug' => ['name' => 'Uyghur', 'script' => 'Arab', 'native' => 'ئۇيغۇرچە', 'regional' => 'ug_CN'],
// 'ur' => ['name' => 'Urdu', 'script' => 'Arab', 'native' => 'اردو', 'regional' => 'ur_PK'],
// 'ar' => ['name' => 'Arabic', 'script' => 'Arab', 'native' => 'العربية', 'regional' => 'ar_AE'],
// 'uz-Arab' => ['name' => 'Uzbek (Arabic)', 'script' => 'Arab', 'native' => 'اۉزبېک', 'regional' => ''],
// 'tg-Arab' => ['name' => 'Tajik (Arabic)', 'script' => 'Arab', 'native' => 'تاجیکی', 'regional' => 'tg_TJ'],
// 'sd' => ['name' => 'Sindhi', 'script' => 'Arab', 'native' => 'سنڌي', 'regional' => 'sd_IN'],
// 'fa' => ['name' => 'Persian', 'script' => 'Arab', 'native' => 'فارسی', 'regional' => 'fa_IR'],
// 'pa-Arab' => ['name' => 'Punjabi (Arabic)', 'script' => 'Arab', 'native' => 'پنجاب', 'regional' => 'pa_IN'],
// 'ps' => ['name' => 'Pashto', 'script' => 'Arab', 'native' => 'پښتو', 'regional' => 'ps_AF'],
// 'ks' => ['name' => 'Kashmiri (Arabic)', 'script' => 'Arab', 'native' => 'کأشُر', 'regional' => 'ks_IN'],
// 'ku' => ['name' => 'Kurdish', 'script' => 'Arab', 'native' => 'کوردی', 'regional' => 'ku_TR'],
// 'dv' => ['name' => 'Divehi', 'script' => 'Thaa', 'native' => 'ދިވެހިބަސް', 'regional' => 'dv_MV'],
// 'ks-Deva' => ['name' => 'Kashmiri (Devaganari)', 'script' => 'Deva', 'native' => 'कॉशुर', 'regional' => 'ks_IN'],
// 'kok' => ['name' => 'Konkani', 'script' => 'Deva', 'native' => 'कोंकणी', 'regional' => 'kok_IN'],
// 'doi' => ['name' => 'Dogri', 'script' => 'Deva', 'native' => 'डोगरी', 'regional' => 'doi_IN'],
// 'ne' => ['name' => 'Nepali', 'script' => 'Deva', 'native' => 'नेपाली', 'regional' => ''],
// 'pra' => ['name' => 'Prakrit', 'script' => 'Deva', 'native' => 'प्राकृत', 'regional' => ''],
// 'brx' => ['name' => 'Bodo', 'script' => 'Deva', 'native' => 'बड़ो', 'regional' => 'brx_IN'],
// 'bra' => ['name' => 'Braj', 'script' => 'Deva', 'native' => 'ब्रज भाषा', 'regional' => ''],
// 'mr' => ['name' => 'Marathi', 'script' => 'Deva', 'native' => 'मराठी', 'regional' => 'mr_IN'],
// 'mai' => ['name' => 'Maithili', 'script' => 'Tirh', 'native' => 'मैथिली', 'regional' => 'mai_IN'],
// 'raj' => ['name' => 'Rajasthani', 'script' => 'Deva', 'native' => 'राजस्थानी', 'regional' => ''],
// 'sa' => ['name' => 'Sanskrit', 'script' => 'Deva', 'native' => 'संस्कृतम्', 'regional' => 'sa_IN'],
// 'hi' => ['name' => 'Hindi', 'script' => 'Deva', 'native' => 'हिन्दी', 'regional' => 'hi_IN'],
// 'as' => ['name' => 'Assamese', 'script' => 'Beng', 'native' => 'অসমীয়া', 'regional' => 'as_IN'],
// 'bn' => ['name' => 'Bengali', 'script' => 'Beng', 'native' => 'বাংলা', 'regional' => 'bn_BD'],
// 'mni' => ['name' => 'Manipuri', 'script' => 'Beng', 'native' => 'মৈতৈ', 'regional' => 'mni_IN'],
// 'pa' => ['name' => 'Punjabi (Gurmukhi)', 'script' => 'Guru', 'native' => 'ਪੰਜਾਬੀ', 'regional' => 'pa_IN'],
// 'gu' => ['name' => 'Gujarati', 'script' => 'Gujr', 'native' => 'ગુજરાતી', 'regional' => 'gu_IN'],
// 'or' => ['name' => 'Oriya', 'script' => 'Orya', 'native' => 'ଓଡ଼ିଆ', 'regional' => 'or_IN'],
// 'ta' => ['name' => 'Tamil', 'script' => 'Taml', 'native' => 'தமிழ்', 'regional' => 'ta_IN'],
// 'te' => ['name' => 'Telugu', 'script' => 'Telu', 'native' => 'తెలుగు', 'regional' => 'te_IN'],
// 'kn' => ['name' => 'Kannada', 'script' => 'Knda', 'native' => 'ಕನ್ನಡ', 'regional' => 'kn_IN'],
// 'ml' => ['name' => 'Malayalam', 'script' => 'Mlym', 'native' => 'മലയാളം', 'regional' => 'ml_IN'],
// 'si' => ['name' => 'Sinhala', 'script' => 'Sinh', 'native' => 'සිංහල', 'regional' => 'si_LK'],
// 'th' => ['name' => 'Thai', 'script' => 'Thai', 'native' => 'ไทย', 'regional' => 'th_TH'],
// 'lo' => ['name' => 'Lao', 'script' => 'Laoo', 'native' => 'ລາວ', 'regional' => 'lo_LA'],
// 'bo' => ['name' => 'Tibetan', 'script' => 'Tibt', 'native' => 'པོད་སྐད་', 'regional' => 'bo_IN'],
// 'dz' => ['name' => 'Dzongkha', 'script' => 'Tibt', 'native' => 'རྫོང་ཁ', 'regional' => 'dz_BT'],
// 'my' => ['name' => 'Burmese', 'script' => 'Mymr', 'native' => 'မြန်မာဘာသာ', 'regional' => 'my_MM'],
// 'ka' => ['name' => 'Georgian', 'script' => 'Geor', 'native' => 'ქართული', 'regional' => 'ka_GE'],
// 'byn' => ['name' => 'Blin', 'script' => 'Ethi', 'native' => 'ብሊን', 'regional' => 'byn_ER'],
// 'tig' => ['name' => 'Tigre', 'script' => 'Ethi', 'native' => 'ትግረ', 'regional' => 'tig_ER'],
// 'ti' => ['name' => 'Tigrinya', 'script' => 'Ethi', 'native' => 'ትግርኛ', 'regional' => 'ti_ET'],
// 'am' => ['name' => 'Amharic', 'script' => 'Ethi', 'native' => 'አማርኛ', 'regional' => 'am_ET'],
// 'wal' => ['name' => 'Wolaytta', 'script' => 'Ethi', 'native' => 'ወላይታቱ', 'regional' => 'wal_ET'],
// 'chr' => ['name' => 'Cherokee', 'script' => 'Cher', 'native' => 'ᏣᎳᎩ', 'regional' => ''],
// 'iu' => ['name' => 'Inuktitut (Canadian Aboriginal Syllabics)', 'script' => 'Cans', 'native' => 'ᐃᓄᒃᑎᑐᑦ', 'regional' => 'iu_CA'],
// 'oj' => ['name' => 'Ojibwa', 'script' => 'Cans', 'native' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'regional' => ''],
// 'cr' => ['name' => 'Cree', 'script' => 'Cans', 'native' => 'ᓀᐦᐃᔭᐍᐏᐣ', 'regional' => ''],
// 'km' => ['name' => 'Khmer', 'script' => 'Khmr', 'native' => 'ភាសាខ្មែរ', 'regional' => 'km_KH'],
// 'mn-Mong' => ['name' => 'Mongolian (Mongolian)', 'script' => 'Mong', 'native' => 'ᠮᠣᠨᠭᠭᠣᠯ ᠬᠡᠯᠡ', 'regional' => 'mn_MN'],
// 'shi-Tfng' => ['name' => 'Tachelhit (Tifinagh)', 'script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
// 'tzm' => ['name' => 'Central Atlas Tamazight (Tifinagh)','script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
// 'yue' => ['name' => 'Yue', 'script' => 'Hant', 'native' => '廣州話', 'regional' => 'yue_HK'],
// 'ja' => ['name' => 'Japanese', 'script' => 'Jpan', 'native' => '日本語', 'regional' => 'ja_JP'],
// 'zh' => ['name' => 'Chinese (Simplified)', 'script' => 'Hans', 'native' => '简体中文', 'regional' => 'zh_CN'],
// 'zh-Hant' => ['name' => 'Chinese (Traditional)', 'script' => 'Hant', 'native' => '繁體中文', 'regional' => 'zh_CN'],
// 'ii' => ['name' => 'Sichuan Yi', 'script' => 'Yiii', 'native' => 'ꆈꌠꉙ', 'regional' => ''],
// 'vai' => ['name' => 'Vai (Vai)', 'script' => 'Vaii', 'native' => 'ꕙꔤ', 'regional' => ''],
// 'jv-Java' => ['name' => 'Javanese (Javanese)', 'script' => 'Java', 'native' => 'ꦧꦱꦗꦮ', 'regional' => ''],
// 'ko' => ['name' => 'Korean', 'script' => 'Hang', 'native' => '한국어', 'regional' => 'ko_KR'],
],
// @phpcs:enable

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
@ -33,7 +35,7 @@ return [
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],
/*
@ -57,73 +59,73 @@ return [
],
'stack' => [
'driver' => 'stack',
'channels' => explode(',', (string) env('LOG_STACK', 'single')),
'driver' => 'stack',
'channels' => explode(',', (string) env('LOG_STACK', 'single')),
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'handler_with' => [
'stream' => 'php://stderr',
],
'formatter' => env('LOG_STDERR_FORMATTER'),
'formatter' => env('LOG_STDERR_FORMATTER'),
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
'driver' => 'monolog',
'driver' => 'monolog',
'handler' => NullHandler::class,
],
@ -132,18 +134,18 @@ return [
],
'stdout' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDOUT_FORMATTER'),
'with' => [
'with' => [
'stream' => 'php://stdout',
],
],
'k8s' => [
'driver' => 'stack',
'channels' => ['daily', 'stdout'],
'driver' => 'stack',
'channels' => ['daily', 'stdout'],
'ignore_exceptions' => false,
],
],

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
/*
@ -38,14 +40,14 @@ return [
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'scheme' => env('MAIL_SCHEME'),
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'transport' => 'smtp',
'scheme' => env('MAIL_SCHEME'),
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env(
'MAIL_EHLO_DOMAIN',
parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)
@ -66,12 +68,12 @@ return [
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
@ -80,7 +82,7 @@ return [
'failover' => [
'transport' => 'failover',
'mailers' => [
'mailers' => [
'smtp',
'log',
],
@ -89,7 +91,7 @@ return [
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'mailers' => [
'ses',
'postmark',
],
@ -111,7 +113,7 @@ return [
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
];

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
/*
@ -36,40 +38,40 @@ return [
],
'database' => [
'driver' => 'database',
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'driver' => 'database',
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'after_commit' => false,
],
@ -82,7 +84,7 @@ return [
],
'failover' => [
'driver' => 'failover',
'driver' => 'failover',
'connections' => [
'database',
'deferred',
@ -104,7 +106,7 @@ return [
'batching' => [
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'job_batches',
'table' => 'job_batches',
],
/*
@ -121,9 +123,9 @@ return [
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
'table' => 'failed_jobs',
],
];

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
/*
@ -23,7 +25,7 @@ return [
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
@ -31,7 +33,7 @@ return [
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Support\Str;
return [

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Laravel\Telescope\Http\Middleware\Authorize;
use Laravel\Telescope\Watchers;
@ -13,9 +15,7 @@ return [
* This option may be used to disable all Telescope watchers regardless
* of their individual configuration, which simply provides a single
* and convenient way to enable or disable Telescope data storage.
*
*/
'enabled' => env('TELESCOPE_ENABLED', true),
/**
@ -26,9 +26,7 @@ return [
* This is the subdomain where Telescope will be accessible from. If the
* setting is null, Telescope will reside under the same domain as the
* application. Otherwise, this value will be used as the subdomain.
*
*/
'domain' => env('TELESCOPE_DOMAIN'),
/**
@ -39,9 +37,7 @@ return [
* This is the URI path where Telescope will be accessible from. Feel free
* to change this path to anything you like. Note that the URI will not
* affect the paths of its internal API that aren't exposed to users.
*
*/
'path' => env('TELESCOPE_PATH', config('uwil-backend.routes.prefix') . '/telescope'),
/**
@ -52,9 +48,7 @@ return [
* This configuration options determines the storage driver that will
* be used to store Telescope's data. In addition, you may set any
* custom options as needed by the particular driver you choose.
*
*/
'driver' => env('TELESCOPE_DRIVER', 'database'),
'storage' => [
@ -72,9 +66,7 @@ return [
* This configuration options determines the queue connection and queue
* which will be used to process ProcessPendingUpdate jobs. This can
* be changed if you would prefer to use a non-default connection.
*
*/
'queue' => [
'connection' => env('TELESCOPE_QUEUE_CONNECTION', null),
'queue' => env('TELESCOPE_QUEUE', null),
@ -88,9 +80,7 @@ return [
* These middleware will be assigned to every Telescope route, giving you
* the chance to add your own middleware to this list or change any of
* the existing middleware. Or, you can simply stick with this list.
*
*/
'middleware' => [
Authorize::class,
],
@ -103,9 +93,7 @@ return [
* The following array lists the URI paths and Artisan commands that will
* not be watched by Telescope. In addition to this list, some Laravel
* commands, like migrations and queue commands, are always ignored.
*
*/
'only_paths' => [],
'ignore_paths' => [
@ -124,9 +112,7 @@ return [
* The following array lists the "watchers" that will be registered with
* Telescope. The watchers gather the application's profile data when
* a request or task is executed. Feel free to customize this list.
*
*/
'watchers' => [
Watchers\BatchWatcher::class => env('TELESCOPE_BATCH_WATCHER', true),
Watchers\CacheWatcher::class => [

View file

@ -1,5 +1,11 @@
<?php
declare(strict_types=1);
use App\Http\Requests\Back\Users\StoreUserRequest;
use App\Http\Requests\Back\Users\UpdateUserRequest;
use App\Models\User;
return [
/**
@ -11,7 +17,6 @@ return [
* - prefix: string.
* - name: string.
*/
'routes' => [
'prefix' => '/',
'name' => 'back.',
@ -25,7 +30,6 @@ return [
* This option may be used to active or not the saml connection.
* - enabled: boolean.
*/
'saml' => [
'enabled' => false,
],
@ -40,12 +44,11 @@ return [
* - store: class.
* - update: class.
*/
'user' => [
'model' => \App\Models\User::class,
'model' => User::class,
'requests' => [
'store' => \App\Http\Requests\Back\Users\StoreUserRequest::class,
'update' => \App\Http\Requests\Back\Users\UpdateUserRequest::class,
'store' => StoreUserRequest::class,
'update' => UpdateUserRequest::class,
],
],
];

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\Brand;
@ -28,7 +30,7 @@ class BrandFactory extends Factory
public function definition(): array
{
return [
"name" => fake()->unique()->words(3, true),
'name' => fake()->unique()->words(3, true),
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\GitlabIssue;
@ -28,20 +30,21 @@ class GitlabIssueFactory extends Factory
public function definition(): array
{
$isClosed = fake()->boolean(25);
return [
"title" => fake()->unique()->words(3, true),
"url" => fake()->unique()->url(),
"estimate_time" => fake()->boolean(75) ? fake()->numberBetween(1, 32) * 900 : 0,
"spent_time" => fake()->boolean(75) ? fake()->numberBetween(1, 32) * 900 : 0,
"is_closed" => $isClosed,
"gitlab_id" => fake()->unique()->numberBetween(1, 1000),
"gitlab_iid" => fake()->numberBetween(1, 1000),
"milestone_iid" => fake()->boolean(75) ? fake()->numberBetween(1, 1000) : null,
"gitlab_project_id" => fake()->unique()->numberBetween(1, 1000),
"g_created_at" => fake()->date(),
"g_updated_at" => fake()->date(),
"g_closed_at" => $isClosed ? fake()->date() : null,
"g_due_date" => fake()->boolean(25) ? fake()->date() : null,
'title' => fake()->unique()->words(3, true),
'url' => fake()->unique()->url(),
'estimate_time' => fake()->boolean(75) ? fake()->numberBetween(1, 32) * 900 : 0,
'spent_time' => fake()->boolean(75) ? fake()->numberBetween(1, 32) * 900 : 0,
'is_closed' => $isClosed,
'gitlab_id' => fake()->unique()->numberBetween(1, 1000),
'gitlab_iid' => fake()->numberBetween(1, 1000),
'milestone_iid' => fake()->boolean(75) ? fake()->numberBetween(1, 1000) : null,
'gitlab_project_id' => fake()->unique()->numberBetween(1, 1000),
'g_created_at' => fake()->date(),
'g_updated_at' => fake()->date(),
'g_closed_at' => $isClosed ? fake()->date() : null,
'g_due_date' => fake()->boolean(25) ? fake()->date() : null,
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\GitlabIssue;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\GitlabLabel;
@ -28,8 +30,8 @@ class GitlabLabelFactory extends Factory
public function definition(): array
{
return [
"name" => fake()->unique()->words(3, true),
"gitlab_id" => fake()->unique()->numberBetween(1, 1000),
'name' => fake()->unique()->words(3, true),
'gitlab_id' => fake()->unique()->numberBetween(1, 1000),
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\GitlabMilestone;
@ -28,17 +30,18 @@ class GitlabMilestoneFactory extends Factory
public function definition(): array
{
$isClosed = fake()->boolean(25);
return [
"title" => fake()->words(3, true),
"url" => fake()->url(),
"is_closed" => $isClosed,
"gitlab_id" => fake()->numberBetween(1, 1000),
"gitlab_iid" => fake()->numberBetween(1, 1000),
"gitlab_project_id" => fake()->numberBetween(1, 1000),
"g_created_at" => fake()->date(),
"g_updated_at" => fake()->date(),
"g_closed_at" => $isClosed ? fake()->date() : null,
"g_due_date" => fake()->boolean(25) ? fake()->date() : null,
'title' => fake()->words(3, true),
'url' => fake()->url(),
'is_closed' => $isClosed,
'gitlab_id' => fake()->numberBetween(1, 1000),
'gitlab_iid' => fake()->numberBetween(1, 1000),
'gitlab_project_id' => fake()->numberBetween(1, 1000),
'g_created_at' => fake()->date(),
'g_updated_at' => fake()->date(),
'g_closed_at' => $isClosed ? fake()->date() : null,
'g_due_date' => fake()->boolean(25) ? fake()->date() : null,
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\GitlabProject;
@ -28,10 +30,10 @@ class GitlabProjectFactory extends Factory
public function definition(): array
{
return [
"name" => fake()->unique()->words(3, true),
"url" => fake()->unique()->url(),
"is_archived" => fake()->boolean(25),
"gitlab_id" => fake()->unique()->numberBetween(1, 1000),
'name' => fake()->unique()->words(3, true),
'url' => fake()->unique()->url(),
'is_archived' => fake()->boolean(25),
'gitlab_id' => fake()->unique()->numberBetween(1, 1000),
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\InvoiceCompany;
@ -28,7 +30,7 @@ class InvoiceCompanyFactory extends Factory
public function definition(): array
{
return [
"name" => fake()->words(3, true),
'name' => fake()->words(3, true),
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\InvoicePackage;
@ -28,9 +30,9 @@ class InvoicePackageFactory extends Factory
public function definition(): array
{
return [
"name" => fake()->words(3, true),
"amount" => fake()->randomFloat(2, 1, 1000),
"published" => fake()->boolean(75),
'name' => fake()->words(3, true),
'amount' => fake()->randomFloat(2, 1, 1000),
'published' => fake()->boolean(75),
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Enums\NoticeTypeEnum;
@ -29,9 +31,9 @@ class NoticeFactory extends Factory
public function definition(): array
{
return [
"title" => fake()->words(3, true),
"message" => sprintf("<p>%s</p>", fake()->text(random_int(20, 40))),
"type" => fake()->randomElement(NoticeTypeEnum::cases()),
'title' => fake()->words(3, true),
'message' => sprintf('<p>%s</p>', fake()->text(random_int(20, 40))),
'type' => fake()->randomElement(NoticeTypeEnum::cases()),
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\GitlabProject;
@ -42,11 +44,11 @@ class SiteFactory extends Factory
]);
return [
"name" => fake()->unique()->words(3, true),
"url_re7" => fake()->boolean(75) ? fake()->unique()->url() : null,
"url_prod" => fake()->boolean(75) ? fake()->unique()->url() : null,
"project_manager_id" => fake()->boolean(75) ? $projectManager->getKey() : null,
"gitlab_project_id" => GitlabProject::factory(),
'name' => fake()->unique()->words(3, true),
'url_re7' => fake()->boolean(75) ? fake()->unique()->url() : null,
'url_prod' => fake()->boolean(75) ? fake()->unique()->url() : null,
'project_manager_id' => fake()->boolean(75) ? $projectManager->getKey() : null,
'gitlab_project_id' => GitlabProject::factory(),
];
}
}

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -25,11 +25,9 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::dropIfExists('user_passwords');
}
};
};

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -22,11 +22,9 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::dropIfExists('user_password_reset_tokens');
}
};
};

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -26,8 +26,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -26,8 +26,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -24,8 +24,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -27,8 +27,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -30,8 +30,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -24,8 +24,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -25,8 +25,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -36,8 +36,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -33,8 +33,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,15 +1,15 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -27,8 +27,6 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\Brand;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class BrandSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'brands';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\GitlabIssueLabel;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class GitlabIssueLabelSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'gitlab_issues_labels';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\GitlabIssue;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class GitlabIssueSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'gitlab_issues';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\GitlabLabel;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class GitlabLabelSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'gitlab_labels';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\GitlabMilestone;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class GitlabMilestoneSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'gitlab_milestones';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\GitlabProject;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class GitlabProjectSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'gitlab_projects';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\InvoiceCompany;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class InvoiceCompanySeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'invoice_companies';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\InvoicePackage;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class InvoicePackageSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'invoice_packages';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\Notice;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class NoticeSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'notices';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders\Classic;
use App\Models\Site;
@ -10,13 +12,11 @@ use Illuminate\Database\Seeder;
*/
class SiteSeeder extends Seeder
{
/** @var string $table Associated table to this seeder. */
/** @var string Associated table to this seeder. */
public static string $table = 'sites';
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders;
use Illuminate\Database\Seeder;
@ -10,8 +12,6 @@ class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run(): void
{

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Seeders;
use Illuminate\Database\Seeder;
@ -10,8 +12,6 @@ class MandatorySeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run(): void
{

View file

@ -6,24 +6,24 @@ return [
'failed' => 'Ces identifiants ne correspondent pas à nos enregistrements.',
'password' => 'Le mot de passe fourni est incorrect.',
'throttle' => 'Tentatives de connexion trop nombreuses. Veuillez réessayer dans :seconds secondes.',
"login" => "Se connecter",
"remember" => "Se souvenir de moi",
"forgot_password" => "Mot de passe oublié",
"forgot_password_desc" => "Renseignez votre email pour recevoir un lien de réinitialisation.",
"description" => "Connectez-vous afin d'accéder à notre outil <strong>:appName</strong> !",
"connected" => "Connecté !",
"connected_desc" => "Vous êtes à présent authentifié au Support UWIL.",
"send_link" => "Envoyer le lien",
"mail_sent" => "Mail envoyé !",
"mail_sent_desc" => "Si un compte est associé à l'adresse :email, un e-mail de réinitialisation du mot de passe
'login' => 'Se connecter',
'remember' => 'Se souvenir de moi',
'forgot_password' => 'Mot de passe oublié',
'forgot_password_desc' => 'Renseignez votre email pour recevoir un lien de réinitialisation.',
'description' => "Connectez-vous afin d'accéder à notre outil <strong>:appName</strong> !",
'connected' => 'Connecté !',
'connected_desc' => 'Vous êtes à présent authentifié au Support UWIL.',
'send_link' => 'Envoyer le lien',
'mail_sent' => 'Mail envoyé !',
'mail_sent_desc' => "Si un compte est associé à l'adresse :email, un e-mail de réinitialisation du mot de passe
vous sera envoyé dans quelques instants.",
"mail_sent_user_desc" => "Un e-mail de réinitialisation du mot de passe à été envoyé l'adresse :email.",
'mail_sent_user_desc' => "Un e-mail de réinitialisation du mot de passe à été envoyé l'adresse :email.",
'reset_password' => 'Réinitialiser mot de passe',
'reset_password_desc' => 'Formulaire de réinitialisation du mot de passe de votre compte au back office.',
"reset_your_password" => "Réinitialiser votre mot de passe",
"reset_sent" => "Réinitialisation du mot de passe effectué !",
"reset_sent_desc" => "Mot de passe mis à jour avec succès. Vous pouvez dès à présent vous connecter
avec vos nouveaux identifiants.",
'reset_your_password' => 'Réinitialiser votre mot de passe',
'reset_sent' => 'Réinitialisation du mot de passe effectué !',
'reset_sent_desc' => 'Mot de passe mis à jour avec succès. Vous pouvez dès à présent vous connecter
avec vos nouveaux identifiants.',
'email_hello' => 'Bonjour :firstName :lastName !',
'email_get_reset_password' => 'Vous recevez cet e-mail parce que nous avons reçu une demande de réinitialisation
du mot de passe de votre compte.',

Some files were not shown because too many files have changed in this diff Show more