feat: 🚨 resolve linters errors
This commit is contained in:
parent
b865e75f48
commit
b1e56a8eae
92 changed files with 715 additions and 288 deletions
|
|
@ -114,7 +114,8 @@ 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(
|
||||
'Role',
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class BrandController extends BackendController
|
|||
*
|
||||
* @var \Illuminate\Support\Collection<int,\App\Models\Site>
|
||||
*/
|
||||
private \Illuminate\Support\Collection $siteModels;
|
||||
private readonly \Illuminate\Support\Collection $siteModels;
|
||||
|
||||
/**
|
||||
* Create the controller instance.
|
||||
|
|
@ -124,12 +124,12 @@ class BrandController extends BackendController
|
|||
|
||||
if ($brand->saveOrFail()) {
|
||||
$brand->sites()->syncWithoutDetaching(Arr::get($validatedData, 'sites'));
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $brand)
|
||||
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 redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -154,7 +154,7 @@ class BrandController extends BackendController
|
|||
* Update the specified resource.
|
||||
*
|
||||
* @param \App\Http\Requests\Back\Brands\UpdateBrandRequest $request
|
||||
* @param \App\Models\Brand $brand
|
||||
* @param \App\Models\Brand $brand
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function update(
|
||||
|
|
@ -167,12 +167,12 @@ class BrandController extends BackendController
|
|||
|
||||
if ($brand->saveOrFail()) {
|
||||
$brand->sites()->sync(Arr::get($validatedData, 'sites'));
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $brand)
|
||||
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 redirect()->route("{$this->routeName}{$this->modelName}.edit", $brand)
|
||||
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)),
|
||||
]));
|
||||
|
|
@ -187,7 +187,7 @@ class BrandController extends BackendController
|
|||
*/
|
||||
public function duplicate(Brand $brand): \Inertia\Response
|
||||
{
|
||||
$brand->loadMissing(Brand::$cacheRelations ?? []);
|
||||
$brand->loadMissing(Brand::getCacheRelations());
|
||||
$replica = $brand->replicate();
|
||||
collect($brand->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
|
||||
return $this->create($replica);
|
||||
|
|
@ -204,14 +204,14 @@ class BrandController extends BackendController
|
|||
$brand = Brand::withTrashed()->findOrFail($brand);
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($brand->restore()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -227,14 +227,14 @@ class BrandController extends BackendController
|
|||
{
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($brand->delete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -253,14 +253,14 @@ class BrandController extends BackendController
|
|||
}
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($brand->forceDelete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
|
|||
|
|
@ -108,12 +108,12 @@ class InvoiceCompanyController extends BackendController
|
|||
$invoice_company->fill($request->validated());
|
||||
|
||||
if ($invoice_company->saveOrFail()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $invoice_company)
|
||||
return to_route("{$this->routeName}{$this->modelName}.edit", $invoice_company)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -148,12 +148,12 @@ class InvoiceCompanyController extends BackendController
|
|||
$invoice_company->fill($request->validated());
|
||||
|
||||
if ($invoice_company->saveOrFail()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $invoice_company)
|
||||
return to_route("{$this->routeName}{$this->modelName}.edit", $invoice_company)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_updated', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $invoice_company)
|
||||
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)),
|
||||
]));
|
||||
|
|
@ -168,9 +168,10 @@ class InvoiceCompanyController extends BackendController
|
|||
*/
|
||||
public function duplicate(InvoiceCompany $invoice_company): \Inertia\Response
|
||||
{
|
||||
$invoice_company->loadMissing(InvoiceCompany::$cacheRelations ?? []);
|
||||
$invoice_company->loadMissing(InvoiceCompany::getCacheRelations());
|
||||
$replica = $invoice_company->replicate();
|
||||
collect($invoice_company->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
|
||||
collect($invoice_company->getRelations())
|
||||
->each(fn($value, $relation) => $replica->setRelation($relation, $value));
|
||||
return $this->create($replica);
|
||||
}
|
||||
|
||||
|
|
@ -185,14 +186,14 @@ class InvoiceCompanyController extends BackendController
|
|||
$invoice_company = InvoiceCompany::withTrashed()->findOrFail($invoice_company);
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($invoice_company->restore()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -208,14 +209,14 @@ class InvoiceCompanyController extends BackendController
|
|||
{
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($invoice_company->delete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -234,14 +235,14 @@ class InvoiceCompanyController extends BackendController
|
|||
}
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($invoice_company->forceDelete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
|
|||
|
|
@ -108,12 +108,12 @@ class InvoicePackageController extends BackendController
|
|||
$invoice_package->fill($request->validated());
|
||||
|
||||
if ($invoice_package->saveOrFail()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $invoice_package)
|
||||
return to_route("{$this->routeName}{$this->modelName}.edit", $invoice_package)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -148,12 +148,12 @@ class InvoicePackageController extends BackendController
|
|||
$invoice_package->fill($request->validated());
|
||||
|
||||
if ($invoice_package->saveOrFail()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $invoice_package)
|
||||
return to_route("{$this->routeName}{$this->modelName}.edit", $invoice_package)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_updated', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $invoice_package)
|
||||
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)),
|
||||
]));
|
||||
|
|
@ -168,9 +168,10 @@ class InvoicePackageController extends BackendController
|
|||
*/
|
||||
public function duplicate(InvoicePackage $invoice_package): \Inertia\Response
|
||||
{
|
||||
$invoice_package->loadMissing(InvoicePackage::$cacheRelations ?? []);
|
||||
$invoice_package->loadMissing(InvoicePackage::getCacheRelations());
|
||||
$replica = $invoice_package->replicate();
|
||||
collect($invoice_package->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
|
||||
collect($invoice_package->getRelations())
|
||||
->each(fn($value, $relation) => $replica->setRelation($relation, $value));
|
||||
return $this->create($replica);
|
||||
}
|
||||
|
||||
|
|
@ -185,14 +186,14 @@ class InvoicePackageController extends BackendController
|
|||
$invoice_package = InvoicePackage::withTrashed()->findOrFail($invoice_package);
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($invoice_package->restore()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -208,14 +209,14 @@ class InvoicePackageController extends BackendController
|
|||
{
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($invoice_package->delete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -234,14 +235,14 @@ class InvoicePackageController extends BackendController
|
|||
}
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($invoice_package->forceDelete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
|
|||
|
|
@ -108,12 +108,12 @@ class NoticeController extends BackendController
|
|||
$notice->fill($request->validated());
|
||||
|
||||
if ($notice->saveOrFail()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $notice)
|
||||
return to_route("{$this->routeName}{$this->modelName}.edit", $notice)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -148,12 +148,12 @@ class NoticeController extends BackendController
|
|||
$notice->fill($request->validated());
|
||||
|
||||
if ($notice->saveOrFail()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $notice)
|
||||
return to_route("{$this->routeName}{$this->modelName}.edit", $notice)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_updated', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $notice)
|
||||
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)),
|
||||
]));
|
||||
|
|
@ -168,7 +168,7 @@ class NoticeController extends BackendController
|
|||
*/
|
||||
public function duplicate(Notice $notice): \Inertia\Response
|
||||
{
|
||||
$notice->loadMissing(Notice::$cacheRelations ?? []);
|
||||
$notice->loadMissing(Notice::getCacheRelations());
|
||||
$replica = $notice->replicate();
|
||||
collect($notice->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
|
||||
return $this->create($replica);
|
||||
|
|
@ -185,14 +185,14 @@ class NoticeController extends BackendController
|
|||
$notice = Notice::withTrashed()->findOrFail($notice);
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($notice->restore()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -208,14 +208,14 @@ class NoticeController extends BackendController
|
|||
{
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($notice->delete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -234,14 +234,14 @@ class NoticeController extends BackendController
|
|||
}
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($notice->forceDelete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ class SiteController extends BackendController
|
|||
/**
|
||||
* Project managers collection.
|
||||
*
|
||||
* @var \Illuminate\Support\Collection<int,\Uwil\LaravelBackend\Models\User>
|
||||
* @var \Illuminate\Support\Collection<int,\App\Models\User>
|
||||
*/
|
||||
private \Illuminate\Support\Collection $userModelsProjectManager;
|
||||
private readonly \Illuminate\Support\Collection $userModelsProjectManager;
|
||||
|
||||
/**
|
||||
* Project managers collection.
|
||||
*
|
||||
* @var \Illuminate\Support\Collection<int,\Uwil\LaravelBackend\Models\User>
|
||||
* @var \Illuminate\Support\Collection<int,\App\Models\User>
|
||||
*/
|
||||
private \Illuminate\Support\Collection $userModelsClient;
|
||||
private readonly \Illuminate\Support\Collection $userModelsClient;
|
||||
|
||||
/**
|
||||
* Create the controller instance.
|
||||
|
|
@ -41,8 +41,10 @@ class SiteController extends BackendController
|
|||
{
|
||||
parent::__construct();
|
||||
$this->authorizeResource(Site::class);
|
||||
$this->modelName = Site::modelName();
|
||||
$this->modelPage = Site::modelPage();
|
||||
$this->modelName = Site::modelName();
|
||||
$this->modelPage = Site::modelPage();
|
||||
|
||||
/** @var \Illuminate\Support\Collection<int, \App\Models\User> $userModels */
|
||||
$userModels = User::getModelsCached()
|
||||
->where("published", true)
|
||||
->where('deleted_at', null)
|
||||
|
|
@ -154,12 +156,12 @@ class SiteController extends BackendController
|
|||
|
||||
if ($site->saveOrFail()) {
|
||||
$site->users()->syncWithoutDetaching(Arr::get($validatedData, 'users'));
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $site)
|
||||
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 redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -202,12 +204,12 @@ class SiteController extends BackendController
|
|||
|
||||
if ($site->saveOrFail()) {
|
||||
$site->users()->sync(Arr::get($validatedData, 'users'));
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.edit", $site)
|
||||
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 redirect()->route("{$this->routeName}{$this->modelName}.edit", $site)
|
||||
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)),
|
||||
]));
|
||||
|
|
@ -222,7 +224,7 @@ class SiteController extends BackendController
|
|||
*/
|
||||
public function duplicate(Site $site): \Inertia\Response
|
||||
{
|
||||
$site->loadMissing(Site::$cacheRelations ?? []);
|
||||
$site->loadMissing(Site::getCacheRelations());
|
||||
$replica = $site->replicate();
|
||||
collect($site->getRelations())->each(fn($value, $relation) => $replica->setRelation($relation, $value));
|
||||
return $this->create($replica);
|
||||
|
|
@ -239,14 +241,14 @@ class SiteController extends BackendController
|
|||
$site = Site::withTrashed()->findOrFail($site);
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($site->restore()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_restored', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -262,14 +264,14 @@ class SiteController extends BackendController
|
|||
{
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($site->delete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.index", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
@ -288,14 +290,14 @@ class SiteController extends BackendController
|
|||
}
|
||||
/** @var array<string,string> */
|
||||
$previousQueries = [];
|
||||
\parse_str(\parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
\parse_str((string) \parse_url(url()->previous(), \PHP_URL_QUERY), $previousQueries);
|
||||
if ($site->forceDelete()) {
|
||||
return redirect()->route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
return to_route("{$this->routeName}{$this->modelName}.trash", $previousQueries)
|
||||
->with('success', trans('uwil-backend::crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
return back()
|
||||
->with('error', trans('uwil-backend::crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(trans_choice("models.classes.$this->modelName", 1)),
|
||||
]));
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ use Uwil\LaravelBackend\Controllers\UserController as BackendUserController;
|
|||
*/
|
||||
class UserController extends BackendUserController
|
||||
{
|
||||
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
|
||||
|
||||
/**
|
||||
* Update the specified resource.
|
||||
*
|
||||
|
|
@ -18,11 +20,12 @@ class UserController extends BackendUserController
|
|||
* @param mixed $callback
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
#[\Override]
|
||||
public function store(
|
||||
Request $request,
|
||||
mixed $callback = null,
|
||||
): \Illuminate\Http\RedirectResponse {
|
||||
return parent::store($request, function ($request, $user) {
|
||||
return parent::store($request, function ($request, $user): void {
|
||||
$validatedData = $request->validated();
|
||||
$user->sites()->syncWithoutDetaching(Arr::get($validatedData, 'sites'));
|
||||
if (Arr::get($validatedData, 'gitlab_id')) {
|
||||
|
|
@ -41,12 +44,13 @@ class UserController extends BackendUserController
|
|||
* @param mixed $callback
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
#[\Override]
|
||||
public function update(
|
||||
Request $request,
|
||||
mixed $user,
|
||||
mixed $callback = null,
|
||||
): \Illuminate\Http\RedirectResponse {
|
||||
return parent::update($request, $user, function ($request, $user) {
|
||||
return parent::update($request, $user, function ($request, $user): void {
|
||||
$validatedData = $request->validated();
|
||||
$user->sites()->sync(Arr::get($validatedData, 'sites'));
|
||||
if (Arr::get($validatedData, 'gitlab_id')) {
|
||||
|
|
@ -59,4 +63,6 @@ class UserController extends BackendUserController
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
// phpcs:enable
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class ForgotPasswordRequest extends FormRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class LoginRequest extends BackendLoginRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class ResetPasswordRequest extends FormRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class StoreBrandRequest extends FormRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class StoreInvoiceCompanyRequest extends FormRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class UpdateInvoiceCompanyRequest extends StoreInvoiceCompanyRequest
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
#[\Override]
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Gate::check('update', $this->route('invoice_company'));
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class StoreInvoicePackageRequest extends FormRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class UpdateInvoicePackageRequest extends StoreInvoicePackageRequest
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
#[\Override]
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Gate::check('update', $this->route('invoice_package'));
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class StoreNoticeRequest extends FormRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class UpdateNoticeRequest extends StoreNoticeRequest
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
#[\Override]
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Gate::check('update', $this->route('notice'));
|
||||
|
|
|
|||
|
|
@ -26,16 +26,17 @@ class StoreSiteRequest extends FormRequest
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'project_manager_id' => is_array($this->project_manager_id)
|
||||
? intval($this->project_manager_id[0]) ?? null
|
||||
? intval($this->project_manager_id[0])
|
||||
: $this->project_manager_id,
|
||||
'gitlab_project_id' => is_array($this->gitlab_project_id)
|
||||
? intval($this->gitlab_project_id[0]) ?? null
|
||||
? intval($this->gitlab_project_id[0])
|
||||
: $this->gitlab_project_id,
|
||||
'users' => is_array($this->users) ? array_map('intval', $this->users) : $this->users,
|
||||
'users' => is_array($this->users) ? array_map(intval(...), $this->users) : $this->users,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -62,6 +63,7 @@ class StoreSiteRequest extends FormRequest
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Back\Users\Concerns;
|
||||
|
||||
use Uwil\LaravelBackend\Support\UserRoleRegistry;
|
||||
|
|
@ -74,4 +75,4 @@ trait HasUserRequestRules
|
|||
'sites' => trans_choice('models.classes.sites', \INF),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class ResetPassword extends Mailable
|
|||
/**
|
||||
* @var \App\Models\User $user
|
||||
*/
|
||||
private User $user;
|
||||
private readonly User $user;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
|
|
@ -33,7 +33,7 @@ class ResetPassword extends Mailable
|
|||
public function envelope(): \Illuminate\Mail\Mailables\Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
to: $this->user->getEmailForPasswordReset(),
|
||||
to: [$this->user->getEmailForPasswordReset()],
|
||||
subject: sprintf(
|
||||
'%s - %s',
|
||||
trans('auth.email_title_reset_complete'),
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ class Brand extends Model
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'name',
|
||||
];
|
||||
|
|
@ -46,20 +47,20 @@ class Brand extends Model
|
|||
];
|
||||
|
||||
/**
|
||||
* Relations should be included in the cache.
|
||||
* Get relations to include in the cache.
|
||||
*
|
||||
* @var list<string>
|
||||
* @return list<string>
|
||||
*/
|
||||
public static $cacheRelations = [
|
||||
'sites',
|
||||
];
|
||||
public static function getCacheRelations(): array
|
||||
{
|
||||
return ['sites'];
|
||||
}
|
||||
|
||||
// * RELATIONS.
|
||||
|
||||
/**
|
||||
* Get sites associated to the brand.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Site>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Site,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
|
||||
*/
|
||||
public function sites(): \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class GitlabIssue extends Model implements TranslatableModel
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
"title",
|
||||
"url",
|
||||
|
|
@ -70,6 +71,7 @@ class GitlabIssue extends Model implements TranslatableModel
|
|||
*
|
||||
* @var array<string,string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $casts = [
|
||||
'is_closed' => 'boolean',
|
||||
];
|
||||
|
|
@ -79,12 +81,13 @@ class GitlabIssue extends Model implements TranslatableModel
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (self $model) {
|
||||
static::creating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
static::updating(function (self $model) {
|
||||
static::updating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class GitlabIssueLabel extends Model
|
|||
*
|
||||
* @var string|null
|
||||
*/
|
||||
#[\Override]
|
||||
protected $table = 'gitlab_issues_labels';
|
||||
|
||||
/**
|
||||
|
|
@ -31,6 +32,7 @@ class GitlabIssueLabel extends Model
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'issue_id',
|
||||
'label_id',
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class GitlabLabel extends Model implements TranslatableModel
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'gitlab_id',
|
||||
|
|
@ -48,12 +49,13 @@ class GitlabLabel extends Model implements TranslatableModel
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (self $model) {
|
||||
static::creating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
static::updating(function (self $model) {
|
||||
static::updating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class GitlabMilestone extends Model implements TranslatableModel
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
"title",
|
||||
"url",
|
||||
|
|
@ -64,6 +65,7 @@ class GitlabMilestone extends Model implements TranslatableModel
|
|||
*
|
||||
* @var array<string,string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $casts = [
|
||||
'is_closed' => 'boolean',
|
||||
];
|
||||
|
|
@ -73,12 +75,13 @@ class GitlabMilestone extends Model implements TranslatableModel
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (self $model) {
|
||||
static::creating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
static::updating(function (self $model) {
|
||||
static::updating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class GitlabProject extends Model implements TranslatableModel
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'url',
|
||||
|
|
@ -52,6 +53,7 @@ class GitlabProject extends Model implements TranslatableModel
|
|||
*
|
||||
* @var array<string,string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $casts = [
|
||||
'is_archived' => 'boolean',
|
||||
];
|
||||
|
|
@ -61,12 +63,13 @@ class GitlabProject extends Model implements TranslatableModel
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (self $model) {
|
||||
static::creating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
static::updating(function (self $model) {
|
||||
static::updating(function (self $model): void {
|
||||
self::manageFields($model);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ class GitlabUser extends Model
|
|||
/**
|
||||
* Get user of the gitlab id.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User,\App\Models\GitlabUser>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User,$this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ class InvoiceCompany extends Model
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'name',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class InvoicePackage extends Model
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'amount',
|
||||
|
|
@ -45,6 +46,7 @@ class InvoicePackage extends Model
|
|||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $casts = [
|
||||
'published' => 'boolean',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class Notice extends Model
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'message',
|
||||
|
|
@ -46,6 +47,7 @@ class Notice extends Model
|
|||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $casts = [
|
||||
'type' => NoticeTypeEnum::class,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class Site extends Model
|
|||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'url_re7',
|
||||
|
|
@ -53,17 +54,6 @@ class Site extends Model
|
|||
'name',
|
||||
];
|
||||
|
||||
/**
|
||||
* Relations should be included in the cache.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
public static $cacheRelations = [
|
||||
'projectManager',
|
||||
'gitlabProject',
|
||||
'users',
|
||||
];
|
||||
|
||||
/**
|
||||
* Perform any actions required after the model boots.
|
||||
*
|
||||
|
|
@ -72,7 +62,7 @@ class Site extends Model
|
|||
#[\Override]
|
||||
protected static function booted(): void
|
||||
{
|
||||
$assertUrls = function (self $model) {
|
||||
$assertUrls = function (self $model): void {
|
||||
if ($model->url_re7) {
|
||||
ToolboxHelper::assertNoInternalUrls('url_re7', $model->url_re7);
|
||||
}
|
||||
|
|
@ -85,12 +75,22 @@ class Site extends Model
|
|||
static::updating($assertUrls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get relations to include in the cache.
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public static function getCacheRelations(): array
|
||||
{
|
||||
return ['projectManager', 'gitlabProject', 'users'];
|
||||
}
|
||||
|
||||
// * RELATIONS.
|
||||
|
||||
/**
|
||||
* Get users associated to the site.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\User>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\User,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
|
||||
*/
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||
{
|
||||
|
|
@ -106,7 +106,7 @@ class Site extends Model
|
|||
/**
|
||||
* Get brands associated to the site.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Brand>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Brand,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
|
||||
*/
|
||||
public function brands(): \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||
{
|
||||
|
|
@ -122,7 +122,7 @@ class Site extends Model
|
|||
/**
|
||||
* Get project manager of the site.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User,\App\Models\Site>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User,$this>
|
||||
*/
|
||||
public function projectManager(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
|
|
@ -132,7 +132,7 @@ class Site extends Model
|
|||
/**
|
||||
* Get project manager of the site.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\GitlabProject,\App\Models\Site>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\GitlabProject,$this>
|
||||
*/
|
||||
public function gitlabProject(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,24 +12,16 @@ use Uwil\LaravelBackend\Models\User as BackendUser;
|
|||
/**
|
||||
* Extends the package User model with some additionnal data.
|
||||
*
|
||||
* @property-read \App\Models\UserPassword|null $userPassword User's associated password.
|
||||
* @property-read \App\Models\GitlabUser|null $gitlabUser User's associated gitlab id.
|
||||
* @property-read \App\Models\Site|null $sites User's associated sites.
|
||||
* @property-read \App\Models\UserPassword|null $userPassword
|
||||
* User's associated password.
|
||||
* @property-read \App\Models\GitlabUser|null $gitlabUser
|
||||
* 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
|
||||
{
|
||||
/**
|
||||
* Relations should be included in the cache.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
public static $cacheRelations = [
|
||||
'gitlabUser',
|
||||
'sites',
|
||||
];
|
||||
|
||||
/**
|
||||
* Except some fields to the user model fill.
|
||||
*
|
||||
|
|
@ -42,12 +34,23 @@ class User extends BackendUser
|
|||
];
|
||||
|
||||
/**
|
||||
* Relations should be share to views.
|
||||
* Get relations to include in the cache.
|
||||
*
|
||||
* @return array
|
||||
* @return list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
public static function propsRelations(): array
|
||||
public static function getCacheRelations(): array
|
||||
{
|
||||
return ['gitlabUser', 'sites'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Relations should be share to views.
|
||||
*
|
||||
* @return array<int|string,mixed>
|
||||
*/
|
||||
#[\Override]
|
||||
public static function getPropsRelations(): array
|
||||
{
|
||||
return [
|
||||
'gitlabUser',
|
||||
|
|
@ -72,12 +75,12 @@ class User extends BackendUser
|
|||
*
|
||||
* @param string $token
|
||||
* @return void
|
||||
* @phpcs:disable
|
||||
*/
|
||||
// phpstan-ignore-next-line
|
||||
// phpcs:ignore
|
||||
#[\Override]
|
||||
public function sendPasswordResetNotification($token): void
|
||||
{
|
||||
// @phpcs:enable
|
||||
$url = sprintf(
|
||||
"%s?email=%s",
|
||||
url(route(config('uwil-backend.routes.name') . 'reset-password', ['token' => $token], false)),
|
||||
|
|
@ -92,7 +95,7 @@ class User extends BackendUser
|
|||
/**
|
||||
* Get the user's associated password.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\UserPassword,\App\Models\User>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\UserPassword,$this>
|
||||
*/
|
||||
public function userPassword(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
{
|
||||
|
|
@ -102,7 +105,7 @@ class User extends BackendUser
|
|||
/**
|
||||
* Get the user's associated gitlab id.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\GitlabUser,\App\Models\User>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\GitlabUser,$this>
|
||||
*/
|
||||
public function gitlabUser(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
{
|
||||
|
|
@ -112,7 +115,7 @@ class User extends BackendUser
|
|||
/**
|
||||
* Get sites associated to the user.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Site>
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany<\App\Models\Site,$this,\Illuminate\Database\Eloquent\Relations\MorphPivot,'pivot'>
|
||||
*/
|
||||
public function sites(): \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@ namespace App\Providers;
|
|||
|
||||
use App\Enums\NoticeTypeEnum;
|
||||
use App\Models\Brand;
|
||||
use App\Models\GitlabIssue;
|
||||
use App\Models\GitlabLabel;
|
||||
use App\Models\GitlabProject;
|
||||
use App\Models\InvoiceCompany;
|
||||
use App\Models\InvoicePackage;
|
||||
use App\Models\Notice;
|
||||
|
|
|
|||
|
|
@ -14,18 +14,14 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
->withRouting(
|
||||
health: '/up',
|
||||
web: __DIR__ . '/../routes/auth.php',
|
||||
then: function () {
|
||||
then: function (): void {
|
||||
Route::middleware(['web', 'throttle:5,2'])
|
||||
->post('/csp-report', function () {
|
||||
->post('/csp-report', function (): void {
|
||||
$isCspRequest = request()->header('Content-Type') === 'application/csp-report';
|
||||
if (!$isCspRequest or !request()->json('csp-report') or !is_array(request()->json('csp-report'))) {
|
||||
abort(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(function ($v, $k) {
|
||||
return [$k => is_array($v) ? collect($v)->flatten()->implode(', ') : $v];
|
||||
})->all();
|
||||
->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' => '',
|
||||
|
|
@ -42,7 +38,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
})->name('cspReportUri');
|
||||
}
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
$middleware->web(append: [
|
||||
\Uwil\LaravelI18n\Middlewares\ForceLocale::class,
|
||||
\Uwil\LaravelCommon\Middlewares\HandleInertiaRequests::class,
|
||||
|
|
@ -61,7 +57,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
'guest' => \Uwil\LaravelBackend\Middlewares\RedirectIfAuthenticated::class,
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
$exceptions->render(function (HttpException $e, Request $request) {
|
||||
$status = $e->getStatusCode();
|
||||
return InertiaHelper::errorRender($request, $status);
|
||||
|
|
@ -69,9 +65,9 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
/**
|
||||
* Automatic exception capture with Sentry.
|
||||
*/
|
||||
$exceptions->report(function (Throwable $e) {
|
||||
$exceptions->report(function (Throwable $e): void {
|
||||
if (app()->bound('sentry')) {
|
||||
app('sentry')->captureException($e);
|
||||
resolve('sentry')->captureException($e);
|
||||
}
|
||||
});
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,11 +20,12 @@
|
|||
"uwil/laravel-common": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"driftingly/rector-laravel": "^2.4",
|
||||
"fakerphp/faker": "^1.23",
|
||||
"larastan/larastan": "^3.4",
|
||||
"laravel/breeze": "^2.3.0",
|
||||
"laravel/pail": "^1.2.5",
|
||||
"laravel/pint": "^1.27",
|
||||
"laravel/pint": "^1.29",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.6",
|
||||
"phpunit/phpunit": "^12.5.12",
|
||||
|
|
@ -110,6 +111,15 @@
|
|||
],
|
||||
"pre-package-uninstall": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
|
||||
],
|
||||
"phpcs": [
|
||||
"./vendor/bin/phpcs"
|
||||
],
|
||||
"phpstan": [
|
||||
"./vendor/bin/phpstan"
|
||||
],
|
||||
"rector": [
|
||||
"./vendor/bin/rector"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
|
|
|
|||
172
composer.lock
generated
172
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "c7008e1b25e55e3dd4f28ec944534e12",
|
||||
"content-hash": "82b81a0508a8c9794eef9c3cade56489",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
|
|
@ -7567,7 +7567,7 @@
|
|||
"dist": {
|
||||
"type": "path",
|
||||
"url": "packages/laravel-activity-logs",
|
||||
"reference": "988e15d19ea29ad3f9b077057330f226dc963d29"
|
||||
"reference": "6179ca66e6b5a2391114b3775ac13df3888b074f"
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "~13",
|
||||
|
|
@ -7635,7 +7635,7 @@
|
|||
"dist": {
|
||||
"type": "path",
|
||||
"url": "packages/laravel-backend",
|
||||
"reference": "cabc9caa919d4fdcb509558f631416fbdafcc7d2"
|
||||
"reference": "d398fb4df7c3ff2665daf3a09d61002c3cdb05af"
|
||||
},
|
||||
"require": {
|
||||
"diglactic/laravel-breadcrumbs": "^10.0",
|
||||
|
|
@ -7714,7 +7714,7 @@
|
|||
"dist": {
|
||||
"type": "path",
|
||||
"url": "packages/laravel-common",
|
||||
"reference": "db3afe457554ee103cac4a92cf601dc6a39780b1"
|
||||
"reference": "0f14d0137c86569421b672712634a3ea69216764"
|
||||
},
|
||||
"require": {
|
||||
"diglactic/laravel-breadcrumbs": "^10.0",
|
||||
|
|
@ -7794,7 +7794,7 @@
|
|||
"dist": {
|
||||
"type": "path",
|
||||
"url": "packages/laravel-i18n",
|
||||
"reference": "1d14e78522ec29cf95897fbeb1bd0ffd5279c93a"
|
||||
"reference": "288486ca3c34c4f84b7b18e02558a07dfb82f26d"
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "~13",
|
||||
|
|
@ -8113,6 +8113,42 @@
|
|||
],
|
||||
"time": "2025-11-11T04:32:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "driftingly/rector-laravel",
|
||||
"version": "2.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/driftingly/rector-laravel.git",
|
||||
"reference": "5342df61b0a77e5a408744e5686d80a51a07a48d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/5342df61b0a77e5a408744e5686d80a51a07a48d",
|
||||
"reference": "5342df61b0a77e5a408744e5686d80a51a07a48d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0",
|
||||
"rector/rector": "^2.2.7",
|
||||
"webmozart/assert": "^1.11 || ^2.0"
|
||||
},
|
||||
"type": "rector-extension",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorLaravel\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Rector upgrades rules for Laravel Framework",
|
||||
"support": {
|
||||
"issues": "https://github.com/driftingly/rector-laravel/issues",
|
||||
"source": "https://github.com/driftingly/rector-laravel/tree/2.4.0"
|
||||
},
|
||||
"time": "2026-05-22T18:34:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fakerphp/faker",
|
||||
"version": "v1.24.1",
|
||||
|
|
@ -9530,6 +9566,66 @@
|
|||
],
|
||||
"time": "2026-04-18T06:12:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "rector/rector",
|
||||
"version": "2.4.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rectorphp/rector.git",
|
||||
"reference": "4661c582a20f03df585d2e3fdc4af1b83d67a091"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/rectorphp/rector/zipball/4661c582a20f03df585d2e3fdc4af1b83d67a091",
|
||||
"reference": "4661c582a20f03df585d2e3fdc4af1b83d67a091",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.4|^8.0",
|
||||
"phpstan/phpstan": "^2.1.48"
|
||||
},
|
||||
"conflict": {
|
||||
"rector/rector-doctrine": "*",
|
||||
"rector/rector-downgrade-php": "*",
|
||||
"rector/rector-phpunit": "*",
|
||||
"rector/rector-symfony": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "To manipulate phpunit.xml via the custom-rule command"
|
||||
},
|
||||
"bin": [
|
||||
"bin/rector"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Instant Upgrade and Automated Refactoring of any PHP code",
|
||||
"homepage": "https://getrector.com/",
|
||||
"keywords": [
|
||||
"automation",
|
||||
"dev",
|
||||
"migration",
|
||||
"refactoring"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/rectorphp/rector/issues",
|
||||
"source": "https://github.com/rectorphp/rector/tree/2.4.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/tomasvotruba",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-20T19:30:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
"version": "4.2.0",
|
||||
|
|
@ -10672,6 +10768,72 @@
|
|||
}
|
||||
],
|
||||
"time": "2025-12-08T11:19:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "2.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozarts/assert.git",
|
||||
"reference": "9007ea6f45ecf352a9422b36644e4bfc039b9155"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozarts/assert/zipball/9007ea6f45ecf352a9422b36644e4bfc039b9155",
|
||||
"reference": "9007ea6f45ecf352a9422b36644e4bfc039b9155",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-ctype": "*",
|
||||
"ext-date": "*",
|
||||
"ext-filter": "*",
|
||||
"php": "^8.2"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-intl": "",
|
||||
"ext-simplexml": "",
|
||||
"ext-spl": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"psalm": {
|
||||
"pluginClass": "Webmozart\\Assert\\PsalmPlugin"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0-dev",
|
||||
"dev-feature/2-0": "2.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webmozart\\Assert\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Bernhard Schussek",
|
||||
"email": "bschussek@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Woody Gilk",
|
||||
"email": "woody.gilk@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Assertions to validate method input/output with nice error messages.",
|
||||
"keywords": [
|
||||
"assert",
|
||||
"check",
|
||||
"validate"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/webmozarts/assert/issues",
|
||||
"source": "https://github.com/webmozarts/assert/tree/2.4.0"
|
||||
},
|
||||
"time": "2026-05-20T13:07:01+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ return [
|
|||
|
||||
'previous_keys' => [
|
||||
...array_filter(
|
||||
explode(',', env('APP_PREVIOUS_KEYS', ''))
|
||||
explode(',', (string) env('APP_PREVIOUS_KEYS', ''))
|
||||
),
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -59,10 +59,7 @@ return [
|
|||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
(PHP_VERSION_ID >= 80500
|
||||
? \Pdo\Mysql::ATTR_SSL_CA
|
||||
: \PDO::MYSQL_ATTR_SSL_CA
|
||||
) => env('MYSQL_ATTR_SSL_CA'),
|
||||
\Pdo\Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
|
|
@ -82,10 +79,7 @@ return [
|
|||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
(PHP_VERSION_ID >= 80500
|
||||
? \Pdo\Mysql::ATTR_SSL_CA
|
||||
: \PDO::MYSQL_ATTR_SSL_CA
|
||||
) => env('MYSQL_ATTR_SSL_CA'),
|
||||
\Pdo\Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating Brand model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Brand>
|
||||
*/
|
||||
class BrandFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class BrandFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\Brand>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = Brand::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating GitlabIssue model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\GitlabIssue>
|
||||
*/
|
||||
class GitlabIssueFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class GitlabIssueFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\GitlabIssue>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = GitlabIssue::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating GitlabIssueLabel model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\GitlabIssueLabel>
|
||||
*/
|
||||
class GitlabIssueLabelFactory extends Factory
|
||||
{
|
||||
|
|
@ -17,6 +19,7 @@ class GitlabIssueLabelFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\GitlabIssueLabel>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = GitlabIssueLabel::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating GitlabLabel model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\GitlabLabel>
|
||||
*/
|
||||
class GitlabLabelFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class GitlabLabelFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\GitlabLabel>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = GitlabLabel::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating GitlabMilestone model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\GitlabMilestone>
|
||||
*/
|
||||
class GitlabMilestoneFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class GitlabMilestoneFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\GitlabMilestone>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = GitlabMilestone::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating GitlabProject model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\GitlabProject>
|
||||
*/
|
||||
class GitlabProjectFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class GitlabProjectFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\GitlabProject>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = GitlabProject::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating InvoiceCompany model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\InvoiceCompany>
|
||||
*/
|
||||
class InvoiceCompanyFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class InvoiceCompanyFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\InvoiceCompany>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = InvoiceCompany::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating InvoicePackage model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\InvoicePackage>
|
||||
*/
|
||||
class InvoicePackageFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class InvoicePackageFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\InvoicePackage>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = InvoicePackage::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
|||
|
||||
/**
|
||||
* Factory for generating Notice model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Notice>
|
||||
*/
|
||||
class NoticeFactory extends Factory
|
||||
{
|
||||
|
|
@ -16,6 +18,7 @@ class NoticeFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\Notice>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = Notice::class;
|
||||
|
||||
/**
|
||||
|
|
@ -27,7 +30,7 @@ class NoticeFactory extends Factory
|
|||
{
|
||||
return [
|
||||
"title" => fake()->words(3, true),
|
||||
"message" => sprintf("<p>%s</p>", fake()->text(\rand(20, 40))),
|
||||
"message" => sprintf("<p>%s</p>", fake()->text(random_int(20, 40))),
|
||||
"type" => fake()->randomElement(NoticeTypeEnum::cases()),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ use Uwil\LaravelBackend\Support\UserRoleRegistry;
|
|||
|
||||
/**
|
||||
* Factory for generating Site model instances with randomized data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Site>
|
||||
*/
|
||||
class SiteFactory extends Factory
|
||||
{
|
||||
|
|
@ -18,6 +20,7 @@ class SiteFactory extends Factory
|
|||
*
|
||||
* @var class-string<\App\Models\Site>
|
||||
*/
|
||||
#[\Override]
|
||||
protected $model = Site::class;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notices', function (Blueprint $table) {
|
||||
Schema::create('notices', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the notice.');
|
||||
$table->string('title')->comment('Title of the notice.');
|
||||
$table->text('message')->comment('Message of the notice.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('invoice_packages', function (Blueprint $table) {
|
||||
Schema::create('invoice_packages', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the invoice package.');
|
||||
$table->string('name')->comment('Name of the invoice package.');
|
||||
$table->double('amount')->comment('Amount of the invoice package.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('invoice_companies', function (Blueprint $table) {
|
||||
Schema::create('invoice_companies', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the invoice company.');
|
||||
$table->string('name')->comment('Name of the invoice company.');
|
||||
$table->timestamp('created_at')->nullable()->comment('Date the invoice company was created.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gitlab_projects', function (Blueprint $table) {
|
||||
Schema::create('gitlab_projects', function (Blueprint $table): void {
|
||||
$table->id()->comment('Primary key of the gitlab project relation.');
|
||||
$table->string('name')->comment('Name of the gitlab project.');
|
||||
$table->string('url')->unique()->comment('Url of the gitlab project.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sites', function (Blueprint $table) {
|
||||
Schema::create('sites', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the site.');
|
||||
$table->string('name')->unique()->comment('Name of the site.');
|
||||
$table->string('url_re7')->unique()->nullable()->comment('Re7 url of the site.');
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sitables', function (Blueprint $table) {
|
||||
Schema::create('sitables', function (Blueprint $table): void {
|
||||
$table->id()->comment('Primary key of the site relation.');
|
||||
$table->unsignedBigInteger('site_id')->comment('Primary key of the site.');
|
||||
$table->unsignedBigInteger('sitable_id')->comment('Primary key of the associated model.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('brands', function (Blueprint $table) {
|
||||
Schema::create('brands', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the brand.');
|
||||
$table->string('name')->unique()->comment('Name of the brand.');
|
||||
$table->timestamp('created_at')->nullable()->comment('Date the brand was created.');
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gitlab_users', function (Blueprint $table) {
|
||||
Schema::create('gitlab_users', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the gitlab user.');
|
||||
$table->unsignedBigInteger('gitlab_id')->unique()->comment('Gitlab id of the user.');
|
||||
$table->foreignId('user_id')->unique()->comment('Id of the user.')->constrained()->cascadeOnDelete();
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gitlab_labels', function (Blueprint $table) {
|
||||
Schema::create('gitlab_labels', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the gitlab label.');
|
||||
$table->string('name')->unique()->comment('Name of the gitlab label.');
|
||||
$table->unsignedBigInteger('gitlab_id')->unique()->comment('Gitlab id of the gitlab label.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gitlab_issues', function (Blueprint $table) {
|
||||
Schema::create('gitlab_issues', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the gitlab issue.');
|
||||
$table->string('title')->comment('Title of the gitlab issue.');
|
||||
$table->string('url')->unique()->comment('Url of the gitlab issue.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gitlab_milestones', function (Blueprint $table) {
|
||||
Schema::create('gitlab_milestones', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the gitlab milestone.');
|
||||
$table->string('title')->comment('Title of the gitlab milestone.');
|
||||
$table->string('url')->comment('Url of the gitlab milestone.');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gitlab_issues_labels', function (Blueprint $table) {
|
||||
Schema::create('gitlab_issues_labels', function (Blueprint $table): void {
|
||||
$table->id()->comment('Id of the relation.');
|
||||
$table->foreignId('issue_id')->comment('Gitlab issue id of the relation.')
|
||||
->constrained('gitlab_issues')->onUpdate('no action')->onDelete('cascade');
|
||||
|
|
|
|||
|
|
@ -6,12 +6,11 @@
|
|||
<arg name="extensions" value="php" />
|
||||
<file>app/</file>
|
||||
<file>config/</file>
|
||||
<file>database/factories</file>
|
||||
<file>database/factories/</file>
|
||||
<file>routes/</file>
|
||||
<exclude-pattern type="relative">*/vendor/*</exclude-pattern>
|
||||
<rule ref="PSR1" />
|
||||
<rule ref="PSR12" />
|
||||
|
||||
<rule ref="Generic.Classes.DuplicateClassName"/>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
|
||||
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
|
||||
|
|
|
|||
|
|
@ -4,5 +4,8 @@ includes:
|
|||
parameters:
|
||||
paths:
|
||||
- app/
|
||||
- config/
|
||||
- database/factories/
|
||||
- routes/
|
||||
|
||||
level: 7
|
||||
|
|
|
|||
77
pint.json
Normal file
77
pint.json
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
"preset": "laravel",
|
||||
"rules": {
|
||||
"indentation_type": true,
|
||||
"single_line_empty_body": false,
|
||||
"types_spaces": {
|
||||
"space": "single",
|
||||
"space_multiple_catch": "single"
|
||||
},
|
||||
"control_structure_braces": true,
|
||||
"new_with_parentheses": {
|
||||
"anonymous_class": true,
|
||||
"named_class": true
|
||||
},
|
||||
"class_definition": {
|
||||
"single_item_single_line": false,
|
||||
"single_line": false,
|
||||
"space_before_parenthesis": true
|
||||
},
|
||||
"curly_braces_position": {
|
||||
"allow_single_line_empty_anonymous_classes": false,
|
||||
"classes_opening_brace": "next_line_unless_newline_at_signature_end",
|
||||
"anonymous_classes_opening_brace": "next_line_unless_newline_at_signature_end",
|
||||
"control_structures_opening_brace": "same_line",
|
||||
"functions_opening_brace": "next_line_unless_newline_at_signature_end",
|
||||
"anonymous_functions_opening_brace": "same_line"
|
||||
},
|
||||
"binary_operator_spaces": {
|
||||
"default": "align_single_space_minimal",
|
||||
"operators": {
|
||||
"=": "align_single_space",
|
||||
"|": "single_space",
|
||||
"=>": "align_single_space",
|
||||
".=": "align_single_space"
|
||||
}
|
||||
},
|
||||
"concat_space": {
|
||||
"spacing": "one"
|
||||
},
|
||||
"align_multiline_comment": {
|
||||
"comment_type": "all_multiline"
|
||||
},
|
||||
"array_indentation": true,
|
||||
"method_chaining_indentation": true,
|
||||
"statement_indentation": {
|
||||
"stick_comment_to_next_continuous_control_statement": true
|
||||
},
|
||||
"no_unused_imports": true,
|
||||
"fully_qualified_strict_types": {
|
||||
"import_symbols": true,
|
||||
"leading_backslash_in_global_namespace": true,
|
||||
"phpdoc_tags": []
|
||||
},
|
||||
"visibility_required": {
|
||||
"elements": [
|
||||
"const",
|
||||
"method",
|
||||
"property"
|
||||
]
|
||||
},
|
||||
"no_useless_else": true,
|
||||
"function_declaration": {
|
||||
"closure_function_spacing": "one",
|
||||
"closure_fn_spacing": "one",
|
||||
"trailing_comma_single_line": false
|
||||
},
|
||||
"single_line_after_imports": true,
|
||||
"combine_consecutive_issets": true,
|
||||
"array_syntax": {
|
||||
"syntax": "short"
|
||||
},
|
||||
"single_quote": true,
|
||||
"blank_line_after_namespace": true,
|
||||
"blank_line_after_opening_tag": true,
|
||||
"declare_strict_types": true
|
||||
}
|
||||
}
|
||||
56
rector.php
Normal file
56
rector.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use RectorLaravel\Rector\Class_\CommandHiddenPropertyToHiddenAttributeRector;
|
||||
use RectorLaravel\Rector\Class_\DescriptionPropertyToDescriptionAttributeRector;
|
||||
use RectorLaravel\Rector\Class_\FillablePropertyToFillableAttributeRector;
|
||||
use RectorLaravel\Rector\Class_\HiddenPropertyToHiddenAttributeRector;
|
||||
use RectorLaravel\Rector\Class_\ModelCastsPropertyToCastsMethodRector;
|
||||
use RectorLaravel\Rector\Class_\SignaturePropertyToSignatureAttributeRector;
|
||||
use RectorLaravel\Rector\Class_\TablePropertyToTableAttributeRector;
|
||||
use RectorLaravel\Rector\Class_\WithoutTimestampsPropertyToWithoutTimestampsAttributeRector;
|
||||
use RectorLaravel\Rector\MethodCall\ValidationRuleArrayStringValueToArrayRector;
|
||||
use RectorLaravel\Set\LaravelLevelSetList;
|
||||
use RectorLaravel\Set\LaravelSetList;
|
||||
use RectorLaravel\Set\LaravelSetProvider;
|
||||
|
||||
return RectorConfig::configure()
|
||||
->withSetProviders(LaravelSetProvider::class)
|
||||
->withPaths([
|
||||
__DIR__ . '/app',
|
||||
__DIR__ . '/bootstrap',
|
||||
__DIR__ . '/config',
|
||||
__DIR__ . '/database',
|
||||
__DIR__ . '/lang',
|
||||
__DIR__ . '/routes',
|
||||
])
|
||||
->withPhpSets()
|
||||
->withComposerBased(laravel: true)
|
||||
->withSets([
|
||||
LaravelLevelSetList::UP_TO_LARAVEL_130,
|
||||
LaravelSetList::LARAVEL_ARRAYACCESS_TO_METHOD_CALL,
|
||||
LaravelSetList::LARAVEL_CODE_QUALITY,
|
||||
LaravelSetList::LARAVEL_COLLECTION,
|
||||
LaravelSetList::LARAVEL_IF_HELPERS,
|
||||
LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES,
|
||||
LaravelSetList::LARAVEL_TYPE_DECLARATIONS,
|
||||
])
|
||||
->withTypeCoverageLevel(0)
|
||||
->withDeadCodeLevel(0)
|
||||
->withCodeQualityLevel(0)
|
||||
->withSkip([
|
||||
// Disable Laravel notations.
|
||||
CommandHiddenPropertyToHiddenAttributeRector::class,
|
||||
DescriptionPropertyToDescriptionAttributeRector::class,
|
||||
FillablePropertyToFillableAttributeRector::class,
|
||||
HiddenPropertyToHiddenAttributeRector::class,
|
||||
ModelCastsPropertyToCastsMethodRector::class,
|
||||
SignaturePropertyToSignatureAttributeRector::class,
|
||||
TablePropertyToTableAttributeRector::class,
|
||||
WithoutTimestampsPropertyToWithoutTimestampsAttributeRector::class,
|
||||
|
||||
// Validation.
|
||||
ValidationRuleArrayStringValueToArrayRector::class,
|
||||
]);
|
||||
|
|
@ -3,7 +3,7 @@ import { route } from "ziggy-js";
|
|||
// * Other
|
||||
import EnumSelect from "@/back/Components/Inputs/EnumSelect";
|
||||
import { LaravelEnum } from "@/types/global";
|
||||
import addFilterToUrl from "@/back/lib/filters";
|
||||
import AddFilterToUrl from "@/back/lib/filters";
|
||||
|
||||
type Props = {
|
||||
enums: LaravelEnum;
|
||||
|
|
@ -35,7 +35,7 @@ function EnumFilter(props: Props) {
|
|||
...route().params,
|
||||
[name]: selectedStatusName,
|
||||
};
|
||||
addFilterToUrl({ modelName, params });
|
||||
AddFilterToUrl({ modelName, params });
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { route } from "ziggy-js";
|
||||
// * Other
|
||||
import { ModelSelect } from "@/back/Components/Inputs/ModelSelect";
|
||||
import addFilterToUrl from "@/back/lib/filters";
|
||||
import AddFilterToUrl from "@/back/lib/filters";
|
||||
|
||||
type Props = {
|
||||
fieldName: string;
|
||||
|
|
@ -37,7 +37,7 @@ function MultiSelectRelationFilter(props: Props) {
|
|||
...route().params,
|
||||
[name]: valuesArray.length ? valuesArray.join(",") : undefined,
|
||||
};
|
||||
addFilterToUrl({ modelName, params });
|
||||
AddFilterToUrl({ modelName, params });
|
||||
}}
|
||||
defaultValue={valuesFromUrl}
|
||||
responsive={{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { route } from "ziggy-js";
|
||||
// * Other
|
||||
import SimpleSwitch from "@/back/Components/Inputs/SimpleSwitch";
|
||||
import addFilterToUrl from "@/back/lib/filters";
|
||||
import AddFilterToUrl from "@/back/lib/filters";
|
||||
|
||||
type Props = {
|
||||
fieldName: string;
|
||||
|
|
@ -24,7 +24,7 @@ function SwitchFilter(props: Props) {
|
|||
...route().params,
|
||||
[name]: value,
|
||||
};
|
||||
addFilterToUrl({ modelName, params });
|
||||
AddFilterToUrl({ modelName, params });
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ export default function SidebarLinkBrands(
|
|||
auth.policies.brands.create && (
|
||||
<DropdownMenuItem key="create" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.create`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.create`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.CREATION.icon />
|
||||
{transCreate}
|
||||
|
|
@ -63,7 +66,10 @@ export default function SidebarLinkBrands(
|
|||
auth.policies.brands.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.trash`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.trash`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.ARCHIVATION.icon />
|
||||
{transArchives}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ export default function SidebarLinkInvoiceCompanies(
|
|||
auth.policies.invoiceCompanies.create && (
|
||||
<DropdownMenuItem key="create" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.create`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.create`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.CREATION.icon />
|
||||
{transCreate}
|
||||
|
|
@ -63,7 +66,10 @@ export default function SidebarLinkInvoiceCompanies(
|
|||
auth.policies.invoiceCompanies.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.trash`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.trash`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.ARCHIVATION.icon />
|
||||
{transArchives}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ export default function SidebarLinkInvoicePackages(
|
|||
auth.policies.invoicePackages.create && (
|
||||
<DropdownMenuItem key="create" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.create`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.create`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.CREATION.icon />
|
||||
{transCreate}
|
||||
|
|
@ -63,7 +66,10 @@ export default function SidebarLinkInvoicePackages(
|
|||
auth.policies.invoicePackages.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.trash`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.trash`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.ARCHIVATION.icon />
|
||||
{transArchives}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ export default function SidebarLinkNotices(
|
|||
auth.policies.notices.create && (
|
||||
<DropdownMenuItem key="create" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.create`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.create`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.CREATION.icon />
|
||||
{transCreate}
|
||||
|
|
@ -63,7 +66,10 @@ export default function SidebarLinkNotices(
|
|||
auth.policies.notices.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.trash`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.trash`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.ARCHIVATION.icon />
|
||||
{transArchives}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ export default function SidebarLinkSites(
|
|||
auth.policies.sites.create && (
|
||||
<DropdownMenuItem key="create" className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.create`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.create`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.CREATION.icon />
|
||||
{transCreate}
|
||||
|
|
@ -63,7 +66,10 @@ export default function SidebarLinkSites(
|
|||
auth.policies.sites.viewTrash && (
|
||||
<DropdownMenuItem className="p-0">
|
||||
<Button variant="ghost" asChild>
|
||||
<Link href={route(`${routeName}${model}.trash`)} className="w-full">
|
||||
<Link
|
||||
href={route(`${routeName}${model}.trash`)}
|
||||
className="w-full"
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-pascal-case */}
|
||||
<Views.ARCHIVATION.icon />
|
||||
{transArchives}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import SimpleString from "@/back/Components/Inputs/SimpleString";
|
|||
import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
|
||||
import InputError from "@/back/Components/InputError";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import addFilterToUrl from "@/back/lib/filters";
|
||||
import AddFilterToUrl from "@/back/lib/filters";
|
||||
|
||||
type DataTableSearchProps = {
|
||||
modelRoute: string;
|
||||
|
|
@ -33,7 +33,7 @@ export default function DataTableSearch({
|
|||
...route().params,
|
||||
search,
|
||||
};
|
||||
addFilterToUrl({
|
||||
AddFilterToUrl({
|
||||
modelName: modelRoute,
|
||||
params,
|
||||
isArchiveRoute,
|
||||
|
|
@ -45,7 +45,7 @@ export default function DataTableSearch({
|
|||
...route().params,
|
||||
search: undefined,
|
||||
};
|
||||
addFilterToUrl({
|
||||
AddFilterToUrl({
|
||||
modelName: modelRoute,
|
||||
params,
|
||||
isArchiveRoute,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,10 @@ type ActivityLogsIndexProps = {
|
|||
activityLogsEventEnum: ActivityLogsEventEnumProps;
|
||||
};
|
||||
|
||||
const getColumns = (routeName: string, activityLogsEventEnum: ActivityLogsEventEnumProps) => {
|
||||
const getColumns = (
|
||||
routeName: string,
|
||||
activityLogsEventEnum: ActivityLogsEventEnumProps,
|
||||
) => {
|
||||
return [
|
||||
{
|
||||
accessorKey: "event",
|
||||
|
|
@ -150,7 +153,10 @@ const getColumns = (routeName: string, activityLogsEventEnum: ActivityLogsEventE
|
|||
if (event !== activityLogsEventEnum.deleted.value) {
|
||||
return (
|
||||
<BtnOptionnalLinkWithTooltip
|
||||
link={route(`${routeName}${str(model).plural().value()}.show`, modelId)}
|
||||
link={route(
|
||||
`${routeName}${str(model).plural().value()}.show`,
|
||||
modelId,
|
||||
)}
|
||||
content={
|
||||
<>
|
||||
<FileTextIcon />
|
||||
|
|
|
|||
|
|
@ -191,7 +191,11 @@ export default function Show({
|
|||
const { viewAny } = auth.policies.activityLogs;
|
||||
const modelName = usePage().props.modelName as string;
|
||||
const activityLogModel = data.data as ActivityLogModel;
|
||||
const columns = getColumns(appEnv.routes.name, activityLogModel, activityLogsEventEnum);
|
||||
const columns = getColumns(
|
||||
appEnv.routes.name,
|
||||
activityLogModel,
|
||||
activityLogsEventEnum,
|
||||
);
|
||||
const transBackToList = useTrans("uwil-backend::back.crud_back_to_list");
|
||||
const beforeNode = () => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import { toast } from "@/hooks/use-toast";
|
|||
import SimpleSwitch from "@/back/Components/Inputs/SimpleSwitch";
|
||||
|
||||
export default function Login() {
|
||||
const appEnv = (usePage().props.appEnv as AppEnv);
|
||||
const appEnv = usePage().props.appEnv as AppEnv;
|
||||
|
||||
/** Translations. */
|
||||
const transConnected = useTrans("auth.connected");
|
||||
|
|
|
|||
|
|
@ -95,10 +95,10 @@ export default function Form({
|
|||
defaultValues={data.sites}
|
||||
setData={setData}
|
||||
maxCount={5}
|
||||
hideSelectAll={true}
|
||||
required={true}
|
||||
multiple={true}
|
||||
closeButtonVisible={true}
|
||||
hideSelectAll
|
||||
required
|
||||
multiple
|
||||
closeButtonVisible
|
||||
/>
|
||||
</FieldsetWrapper>
|
||||
<div className="col-span-2 text-center">
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ export default function Form({
|
|||
options={selectOptionsClient}
|
||||
defaultValue={data.users}
|
||||
setData={setData}
|
||||
closeButtonVisible={true}
|
||||
closeButtonVisible
|
||||
/>
|
||||
<ModelSelect
|
||||
name="gitlab_project_id"
|
||||
|
|
@ -213,10 +213,10 @@ export default function Form({
|
|||
}
|
||||
setData={setData}
|
||||
maxCount={5}
|
||||
hideSelectAll={true}
|
||||
required={true}
|
||||
hideSelectAll
|
||||
required
|
||||
multiple={false}
|
||||
closeOnSelect={true}
|
||||
closeOnSelect
|
||||
emptyButtonVisible={false}
|
||||
/>
|
||||
</FieldsetWrapper>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { AuthProp, UserModel } from "@/back/types/global";
|
|||
import SubmitButton from "@/back/Components/SubmitButton";
|
||||
import useCrudSubmit from "@/back/hooks/use-crud-submit";
|
||||
import { extractIdsFromDatabasePivotRelation } from "@/lib/mapPivotOptions";
|
||||
import { GetTranslation } from "@/lib/utils";
|
||||
|
||||
export default function Form({
|
||||
model,
|
||||
|
|
@ -187,18 +188,18 @@ export default function Form({
|
|||
{userModel.role.value === getEnumRoleValue("conceptor") &&
|
||||
data.role === getEnumRoleValue("client") && (
|
||||
<FieldsetWrapper
|
||||
title={useTrans("back.form_title_sites")}
|
||||
title={GetTranslation("back.form_title_sites")}
|
||||
icon={<CableIcon className="mr-1" />}
|
||||
description={useTrans("back.form_subtitle_sites")}
|
||||
description={GetTranslation("back.form_subtitle_sites")}
|
||||
>
|
||||
<ModelSelect
|
||||
name="sites"
|
||||
targetModel="sites"
|
||||
field="name"
|
||||
label={str(
|
||||
useTrans("uwil-backend::back.form_associate_to", {
|
||||
GetTranslation("uwil-backend::back.form_associate_to", {
|
||||
params: {
|
||||
attribute: useTrans("models.classes.sites", {
|
||||
attribute: GetTranslation("models.classes.sites", {
|
||||
choice: 2,
|
||||
}),
|
||||
},
|
||||
|
|
@ -211,10 +212,10 @@ export default function Form({
|
|||
defaultValues={data.sites}
|
||||
setData={setData}
|
||||
maxCount={10}
|
||||
hideSelectAll={true}
|
||||
required={true}
|
||||
multiple={true}
|
||||
closeButtonVisible={true}
|
||||
hideSelectAll
|
||||
required
|
||||
multiple
|
||||
closeButtonVisible
|
||||
/>
|
||||
</FieldsetWrapper>
|
||||
)}
|
||||
|
|
@ -222,17 +223,17 @@ export default function Form({
|
|||
(data.role === getEnumRoleValue("project-manager") ||
|
||||
data.role === getEnumRoleValue("developper")) && (
|
||||
<FieldsetWrapper
|
||||
title={useTrans("back.form_title_git")}
|
||||
title={GetTranslation("back.form_title_git")}
|
||||
icon={<GitGraphIcon className="mr-1" />}
|
||||
description={useTrans("back.form_subtitle_git")}
|
||||
description={GetTranslation("back.form_subtitle_git")}
|
||||
inline
|
||||
>
|
||||
<SimpleNumber
|
||||
name="gitlab_id"
|
||||
label={str(
|
||||
useTrans("uwil-backend::back.form_associate_to", {
|
||||
GetTranslation("uwil-backend::back.form_associate_to", {
|
||||
params: {
|
||||
attribute: useTrans("validation.custom.gitlab_id"),
|
||||
attribute: GetTranslation("validation.custom.gitlab_id"),
|
||||
},
|
||||
choice: 1,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -173,9 +173,7 @@ export default function Index({
|
|||
};
|
||||
const { viewAny, viewTrash, create } = auth.policies.users;
|
||||
const routeName = appEnv.routes.name;
|
||||
const isArchiveRoute = route().current(
|
||||
`${routeName}${modelName}.trash`,
|
||||
);
|
||||
const isArchiveRoute = route().current(`${routeName}${modelName}.trash`);
|
||||
const actionModels = isArchiveRoute
|
||||
? [Views.RESTORATION, Views.FORCEDELETION]
|
||||
: [
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export default function useCrudSubmit<TFormData>({
|
|||
data,
|
||||
modelNameTrans,
|
||||
}: UseCrudSubmitParams<TFormData>) {
|
||||
const { locale, routes } = usePage().props.appEnv as AppEnv;
|
||||
const { locale } = usePage().props.appEnv as AppEnv;
|
||||
/** Set messages success/errors */
|
||||
const messages = useCrudMessages({ method, modelNameTrans });
|
||||
const { toast } = useToast();
|
||||
|
|
@ -51,7 +51,7 @@ export default function useCrudSubmit<TFormData>({
|
|||
// eslint-disable-next-line no-param-reassign
|
||||
data.locale = locale;
|
||||
|
||||
const routeUrl = route(`${routes.name}${modelRoute}.${action}`, model?.id);
|
||||
const routeUrl = route(`${modelRoute}${modelRoute}.${action}`, model?.id);
|
||||
post(routeUrl, {
|
||||
preserveScroll: true,
|
||||
onSuccess: () => {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ type RouterFiltersProps = {
|
|||
};
|
||||
isArchiveRoute?: boolean;
|
||||
};
|
||||
export default function addFilterToUrl(props: RouterFiltersProps) {
|
||||
export default function AddFilterToUrl(props: RouterFiltersProps) {
|
||||
const { modelName, params, isArchiveRoute = false } = props;
|
||||
const routeName = (usePage().props.appEnv as AppEnv).routes.name;
|
||||
|
||||
|
|
|
|||
6
resources/ts/back/types/global.d.ts
vendored
6
resources/ts/back/types/global.d.ts
vendored
|
|
@ -16,9 +16,9 @@ type ModelPolicy = {
|
|||
type DefaultModel = {
|
||||
policies: ModelPolicy;
|
||||
id: number;
|
||||
created_at: Date|null;
|
||||
updated_at: Date|null;
|
||||
deleted_at: Date|null;
|
||||
created_at: Date | null;
|
||||
updated_at: Date | null;
|
||||
deleted_at: Date | null;
|
||||
};
|
||||
|
||||
// User type, with policies.
|
||||
|
|
|
|||
16
resources/ts/back/types/project.d.ts
vendored
16
resources/ts/back/types/project.d.ts
vendored
|
|
@ -22,9 +22,9 @@ type GitlabUser = {
|
|||
id: number;
|
||||
gitlab_id: number;
|
||||
user_id: number;
|
||||
created_at: Date|null;
|
||||
updated_at: Date|null;
|
||||
}
|
||||
created_at: Date | null;
|
||||
updated_at: Date | null;
|
||||
};
|
||||
|
||||
type GitlabProjectModel = DefaultModel & {
|
||||
name: TranslationField;
|
||||
|
|
@ -35,7 +35,7 @@ type GitlabProjectModel = DefaultModel & {
|
|||
type GitlabLabelModel = DefaultModel & {
|
||||
name: TranslationField;
|
||||
gitlab_id: number;
|
||||
}
|
||||
};
|
||||
|
||||
type GitlabIssueModel = DefaultModel & {
|
||||
title: TranslationField;
|
||||
|
|
@ -49,9 +49,9 @@ type GitlabIssueModel = DefaultModel & {
|
|||
gitlab_project_id: number;
|
||||
g_created_at: Date;
|
||||
g_updated_at: Date;
|
||||
g_closed_at: Date|null;
|
||||
g_due_date: Date|null;
|
||||
}
|
||||
g_closed_at: Date | null;
|
||||
g_due_date: Date | null;
|
||||
};
|
||||
|
||||
type SiteModel = DefaultModel & {
|
||||
name: TranslationField;
|
||||
|
|
@ -67,4 +67,4 @@ type SiteModel = DefaultModel & {
|
|||
type BrandModel = DefaultModel & {
|
||||
name: TranslationField;
|
||||
sites: Array<SiteModel>;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,8 +29,11 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|||
|
||||
const DialogContent = React.forwardRef<
|
||||
React.ElementRef<typeof DialogPrimitive.Content>,
|
||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
||||
>(({ className, children, ...props }, ref) => (
|
||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
||||
title?: string;
|
||||
description?: string;
|
||||
}
|
||||
>(({ className, children, title, description, ...props }, ref) => (
|
||||
<DialogPortal>
|
||||
<DialogOverlay />
|
||||
<DialogPrimitive.Content
|
||||
|
|
@ -41,6 +44,12 @@ const DialogContent = React.forwardRef<
|
|||
)}
|
||||
{...props}
|
||||
>
|
||||
<DialogPrimitive.Title className="sr-only">
|
||||
{title ?? "Dialog"}
|
||||
</DialogPrimitive.Title>
|
||||
<DialogPrimitive.Description className="sr-only">
|
||||
{description ?? ""}
|
||||
</DialogPrimitive.Description>
|
||||
{children}
|
||||
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
||||
<XIcon className="h-4 w-4" />
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ const sheetVariants = cva(
|
|||
{
|
||||
variants: {
|
||||
side: {
|
||||
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
||||
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
||||
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
||||
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
||||
top: "inset-x-0 top-0 data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
||||
bottom: "inset-x-0 bottom-0 data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
||||
left: "inset-y-0 left-0 h-full w-3/4 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
||||
right: "inset-y-0 right-0 h-full w-3/4 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
|
|
@ -49,12 +49,15 @@ const sheetVariants = cva(
|
|||
|
||||
interface SheetContentProps
|
||||
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
||||
VariantProps<typeof sheetVariants> {}
|
||||
VariantProps<typeof sheetVariants> {
|
||||
title?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
const SheetContent = React.forwardRef<
|
||||
React.ElementRef<typeof SheetPrimitive.Content>,
|
||||
SheetContentProps
|
||||
>(({ side = "right", className, children, ...props }, ref) => (
|
||||
>(({ side = "right", className, children, title, description, ...props }, ref) => (
|
||||
<SheetPortal>
|
||||
<SheetOverlay />
|
||||
<SheetPrimitive.Content
|
||||
|
|
@ -62,6 +65,12 @@ const SheetContent = React.forwardRef<
|
|||
className={cn(sheetVariants({ side }), className)}
|
||||
{...props}
|
||||
>
|
||||
<SheetPrimitive.Title className="sr-only">
|
||||
{title ?? "Sheet"}
|
||||
</SheetPrimitive.Title>
|
||||
<SheetPrimitive.Description className="sr-only">
|
||||
{description ?? ""}
|
||||
</SheetPrimitive.Description>
|
||||
{children}
|
||||
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
||||
<XIcon className="h-4 w-4" />
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ use Illuminate\Support\Facades\Route;
|
|||
|
||||
Route::post('users/{user}/send-reset-password-link', [AuthenticatedSessionController::class, 'sendResetPasswordLink'])
|
||||
->name('users.send-reset-password-link');
|
||||
Route::resource('users', UserController::class);
|
||||
Route::resource('users', UserController::class);
|
||||
|
|
|
|||
|
|
@ -7,21 +7,21 @@ use Illuminate\Support\Str;
|
|||
/** @var string $routeName */
|
||||
$routeName = config('uwil-backend.routes.name');
|
||||
|
||||
Breadcrumbs::for("{$routeName}brands.index", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}brands.index", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}dashboard.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans_choice('models.classes.brands', \INF)),
|
||||
route("{$routeName}brands.index")
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}brands.create", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}brands.create", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}brands.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.create')),
|
||||
route("{$routeName}brands.create"),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}brands.edit", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}brands.edit", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}brands.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.edit')),
|
||||
|
|
@ -30,11 +30,11 @@ Breadcrumbs::for("{$routeName}brands.edit", function (Generator $trail) use ($ro
|
|||
])
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}brands.duplicate", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}brands.duplicate", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}brands.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::crud.actions.duplicate')));
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}brands.show", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}brands.show", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}brands.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.visualize')),
|
||||
|
|
@ -43,7 +43,7 @@ Breadcrumbs::for("{$routeName}brands.show", function (Generator $trail) use ($ro
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}brands.trash", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}brands.trash", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}brands.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::back.archives')));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,21 +7,21 @@ use Illuminate\Support\Str;
|
|||
/** @var string $routeName */
|
||||
$routeName = config('uwil-backend.routes.name');
|
||||
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.index", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.index", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}dashboard.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans_choice('models.classes.invoice-companies', \INF)),
|
||||
route("{$routeName}invoice-companies.index")
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.create", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.create", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-companies.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.create')),
|
||||
route("{$routeName}invoice-companies.create"),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.edit", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.edit", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-companies.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.edit')),
|
||||
|
|
@ -30,11 +30,11 @@ Breadcrumbs::for("{$routeName}invoice-companies.edit", function (Generator $trai
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.duplicate", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.duplicate", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-companies.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::crud.actions.duplicate')));
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.show", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.show", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-companies.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.visualize')),
|
||||
|
|
@ -43,7 +43,7 @@ Breadcrumbs::for("{$routeName}invoice-companies.show", function (Generator $trai
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.trash", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-companies.trash", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-companies.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::back.archives')));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,21 +7,21 @@ use Illuminate\Support\Str;
|
|||
/** @var string $routeName */
|
||||
$routeName = config('uwil-backend.routes.name');
|
||||
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.index", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.index", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}dashboard.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans_choice('models.classes.invoice-packages', \INF)),
|
||||
route("{$routeName}invoice-packages.index")
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.create", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.create", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-packages.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.create')),
|
||||
route("{$routeName}invoice-packages.create"),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.edit", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.edit", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-packages.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.edit')),
|
||||
|
|
@ -30,11 +30,11 @@ Breadcrumbs::for("{$routeName}invoice-packages.edit", function (Generator $trail
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.duplicate", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.duplicate", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-packages.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::crud.actions.duplicate')));
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.show", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.show", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-packages.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.visualize')),
|
||||
|
|
@ -43,7 +43,7 @@ Breadcrumbs::for("{$routeName}invoice-packages.show", function (Generator $trail
|
|||
])
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.trash", function (Generator $trail) use ($routeName){
|
||||
Breadcrumbs::for("{$routeName}invoice-packages.trash", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}invoice-packages.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::back.archives')));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,21 +7,21 @@ use Illuminate\Support\Str;
|
|||
/** @var string $routeName */
|
||||
$routeName = config('uwil-backend.routes.name');
|
||||
|
||||
Breadcrumbs::for("{$routeName}notices.index", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}notices.index", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}dashboard.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans_choice('models.classes.notices', \INF)),
|
||||
route("{$routeName}notices.index")
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}notices.create", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}notices.create", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}notices.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.create')),
|
||||
route("{$routeName}notices.create"),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}notices.edit", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}notices.edit", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}notices.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.edit')),
|
||||
|
|
@ -30,11 +30,11 @@ Breadcrumbs::for("{$routeName}notices.edit", function (Generator $trail) use ($r
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}notices.duplicate", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}notices.duplicate", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}notices.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::crud.actions.duplicate')));
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}notices.show", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}notices.show", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}notices.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.visualize')),
|
||||
|
|
@ -43,7 +43,7 @@ Breadcrumbs::for("{$routeName}notices.show", function (Generator $trail) use ($r
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}notices.trash", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}notices.trash", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}notices.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::back.archives')));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,21 +7,21 @@ use Illuminate\Support\Str;
|
|||
/** @var string $routeName */
|
||||
$routeName = config('uwil-backend.routes.name');
|
||||
|
||||
Breadcrumbs::for("{$routeName}sites.index", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}sites.index", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}dashboard.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans_choice('models.classes.sites', \INF)),
|
||||
route("{$routeName}sites.index")
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}sites.create", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}sites.create", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}sites.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.create')),
|
||||
route("{$routeName}sites.create"),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}sites.edit", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}sites.edit", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}sites.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.edit')),
|
||||
|
|
@ -30,11 +30,11 @@ Breadcrumbs::for("{$routeName}sites.edit", function (Generator $trail) use ($rou
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}sites.duplicate", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}sites.duplicate", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}sites.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::crud.actions.duplicate')));
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}sites.show", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}sites.show", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}sites.index");
|
||||
$trail->push(
|
||||
Str::ucfirst(trans('uwil-backend::crud.actions.visualize')),
|
||||
|
|
@ -43,7 +43,7 @@ Breadcrumbs::for("{$routeName}sites.show", function (Generator $trail) use ($rou
|
|||
]),
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for("{$routeName}sites.trash", function (Generator $trail) use ($routeName) {
|
||||
Breadcrumbs::for("{$routeName}sites.trash", function (Generator $trail) use ($routeName): void {
|
||||
$trail->parent("{$routeName}sites.index");
|
||||
$trail->push(Str::ucfirst(trans('uwil-backend::back.archives')));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue