style updates

This commit is contained in:
Mark Gregory
2026-06-23 13:39:02 +01:00
parent e79cadc7f8
commit 3be4ff590f
129 changed files with 482 additions and 404 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ class CreateNewUser implements CreatesNewUsers
/**
* Validate and create a newly registered user with an isolated company tenant.
*
* @param array<string, string> $input
* @param array<string, string> $input
*/
public function create(array $input): User
{
@@ -29,11 +29,11 @@ class CreateNewUser implements CreatesNewUsers
])->validate();
return DB::transaction(function () use ($input): User {
$companyName = $input['company_name'] ?? ($input['name'].' Company');
$companyName = $input['company_name'] ?? ($input['name'] . ' Company');
$company = Company::create([
'name' => $companyName,
'slug' => Str::slug($companyName.'-'.Str::random(6)),
'slug' => Str::slug($companyName . '-' . Str::random(6)),
'status' => 'active',
'timezone' => 'Europe/London',
]);
+1 -1
View File
@@ -14,7 +14,7 @@ class ResetUserPassword implements ResetsUserPasswords
/**
* Validate and reset the user's forgotten password.
*
* @param array<string, string> $input
* @param array<string, string> $input
*/
public function reset(User $user, array $input): void
{
+1 -1
View File
@@ -15,7 +15,7 @@ class UpdateUserPassword implements UpdatesUserPasswords
/**
* Validate and update the user's password.
*
* @param array<string, string> $input
* @param array<string, string> $input
*
* @throws ValidationException
*/
@@ -14,7 +14,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
/**
* Validate and update the given user's profile information.
*
* @param array<string, string> $input
* @param array<string, string> $input
*
* @throws ValidationException
*/
@@ -46,7 +46,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
/**
* Update the given verified user's profile information.
*
* @param array<string, string> $input
* @param array<string, string> $input
*/
protected function updateVerifiedUser(User $user, array $input): void
{
+2 -1
View File
@@ -37,7 +37,8 @@ class AppServiceProvider extends ServiceProvider
app()->isProduction(),
);
Password::defaults(fn (): ?Password => app()->isProduction()
Password::defaults(
fn (): ?Password => app()->isProduction()
? Password::min(12)
->mixedCase()
->letters()
+2 -2
View File
@@ -64,7 +64,7 @@ class FortifyServiceProvider extends ServiceProvider
});
RateLimiter::for('login', function (Request $request) {
$throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip());
$throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())) . '|' . $request->ip());
return Limit::perMinute(5)->by($throttleKey);
});
@@ -73,7 +73,7 @@ class FortifyServiceProvider extends ServiceProvider
$credentialId = $request->input('credential.id');
return Limit::perMinute(10)->by(
($credentialId ?: $request->session()->getId()).'|'.$request->ip(),
($credentialId ?: $request->session()->getId()) . '|' . $request->ip(),
);
});
}
+19 -15
View File
@@ -79,7 +79,7 @@ final class DashboardChartService
FROM EWDAT.ICM688M2
WHERE A5PICKCMTS >= CURRENT DATE - 7 DAYS
GROUP BY DATE(A5PICKCMTS)
ORDER BY PICK_DATE'
ORDER BY PICK_DATE',
);
foreach ($rows as $row) {
@@ -112,7 +112,7 @@ final class DashboardChartService
AND SHDATA LIKE 'Success%'
AND SHDT >= VARCHAR_FORMAT(CURRENT DATE - 7 DAYS, 'YYYYMMDD')
GROUP BY SHDT
ORDER BY SHDT"
ORDER BY SHDT",
);
foreach ($rows as $row) {
@@ -143,7 +143,7 @@ final class DashboardChartService
WHERE SHDT >= VARCHAR_FORMAT(CURRENT DATE - 30 DAYS, 'YYYYMMDD')
GROUP BY TRIM(SHSOURCE)
ORDER BY TOTAL DESC
FETCH FIRST 5 ROWS ONLY"
FETCH FIRST 5 ROWS ONLY",
);
if (! empty($rows)) {
@@ -176,14 +176,14 @@ final class DashboardChartService
WHERE AT9QTY <= AT9WRN
GROUP BY TRIM(AT9WHS)
ORDER BY TOTAL DESC
FETCH FIRST 6 ROWS ONLY'
FETCH FIRST 6 ROWS ONLY',
);
if (! empty($rows)) {
$labels = [];
$data = [];
foreach ($rows as $row) {
$labels[] = 'WH '.trim($row->WAREHOUSE);
$labels[] = 'WH ' . trim($row->WAREHOUSE);
$data[] = (int) $row->TOTAL;
}
}
@@ -209,7 +209,7 @@ final class DashboardChartService
SUM(A5PACKED) AS PACKED_QTY,
SUM(A5RSVQTY - A5PACKED) AS REMAINING_QTY
FROM EWDAT.ICM688M2
WHERE A5RSVQTY > 0'
WHERE A5RSVQTY > 0',
);
if (! empty($rows)) {
@@ -260,7 +260,8 @@ final class DashboardChartService
}
/**
* @param array<int, string> $labels
* @param array<int, string> $labels
*
* @return array<string, int>
*/
private function emptySeries(array $labels): array
@@ -271,9 +272,9 @@ final class DashboardChartService
private function safeCount(string $table, ?string $where = null): int
{
try {
$sql = 'SELECT COUNT(*) AS TOTAL FROM EWDAT.'.$table;
$sql = 'SELECT COUNT(*) AS TOTAL FROM EWDAT.' . $table;
if ($where !== null && trim($where) !== '') {
$sql .= ' WHERE '.$where;
$sql .= ' WHERE ' . $where;
}
$rows = DB::connection('odbc')->select($sql);
@@ -287,8 +288,9 @@ final class DashboardChartService
}
/**
* @param array<int, string> $labels
* @param array<int, int> $data
* @param array<int, string> $labels
* @param array<int, int> $data
*
* @return array<string, mixed>
*/
private function lineChart(array $labels, array $data, string $label): array
@@ -305,8 +307,9 @@ final class DashboardChartService
}
/**
* @param array<int, string> $labels
* @param array<int, int> $data
* @param array<int, string> $labels
* @param array<int, int> $data
*
* @return array<string, mixed>
*/
private function barChart(array $labels, array $data, string $label): array
@@ -322,8 +325,9 @@ final class DashboardChartService
}
/**
* @param array<int, string> $labels
* @param array<int, int> $data
* @param array<int, string> $labels
* @param array<int, int> $data
*
* @return array<string, mixed>
*/
private function doughnutChart(array $labels, array $data, string $label): array