new deployer command

This commit is contained in:
Mark Gregory
2026-09-16 11:53:35 +01:00
parent 5aeeb87b21
commit ce79962289
14 changed files with 31 additions and 43 deletions
@@ -11,6 +11,7 @@ use Modules\Warehouse\app\Models\Warehouse;
class CompanyAddressController extends Controller
{
private const MAX_STRING = self::MAX_STRING;
public function updateCompany(Request $request, Company $company)
{
$this->upsertAddress($request, $company);
@@ -40,12 +41,12 @@ class CompanyAddressController extends Controller
{
$data = $request->validate([
'label' => ['nullable', 'string', 'max:80'],
'attention' => ['nullable', 'string', 'max:255'],
'line_1' => ['required', 'string', 'max:255'],
'line_2' => ['nullable', 'string', 'max:255'],
'line_3' => ['nullable', 'string', 'max:255'],
'locality' => ['required', 'string', 'max:255'],
'administrative_area' => ['nullable', 'string', 'max:255'],
'attention' => ['nullable', 'string', self::MAX_STRING],
'line_1' => ['required', 'string', self::MAX_STRING],
'line_2' => ['nullable', 'string', self::MAX_STRING],
'line_3' => ['nullable', 'string', self::MAX_STRING],
'locality' => ['required', 'string', self::MAX_STRING],
'administrative_area' => ['nullable', 'string', self::MAX_STRING],
'postal_code' => ['nullable', 'string', 'max:32'],
'country_id' => ['required', Rule::exists('countries', 'id')->where('is_active', true)],
'country_subdivision_id' => ['nullable', 'exists:country_subdivisions,id'],
-6
View File
@@ -774,12 +774,6 @@ final class TicketShow extends Component
/**
* Add a case-insensitive LIKE condition that works on PostgreSQL and SQLite tests.
*/
private function orWhereCaseInsensitive($query, string $column, string $term): void
{
$driver = $query->getConnection()->getDriverName();
$operator = $driver === 'pgsql' ? $this->gitCommitLikeOperator() : 'LIKE';
$query->orWhere($column, $operator, '%' . $term . '%');
}
/**
* Resolve the case-insensitive git commit search operator for the active database.
+2 -2
View File
@@ -9,7 +9,7 @@ use Modules\Helpdesk\Models\Ticket;
final class TicketPolicy
{
public function viewAny(User $user): bool
public function viewAny(User $_user): bool
{
return true;
}
@@ -21,7 +21,7 @@ final class TicketPolicy
|| (int) $ticket->user_id === (int) $user->id;
}
public function create(User $user): bool
public function create(User $_user): bool
{
return true;
}
@@ -53,11 +53,14 @@
<section class="overflow-hidden rounded-2xl border border-zinc-700 bg-zinc-950 shadow-sm">
<div class="overflow-auto">
<table class="min-w-full border-collapse font-mono text-xs leading-6">
<caption class="sr-only">Data table</caption>
<caption class="sr-only">Source code for {{ $attachmentName }}</caption>
<thead class="sr-only">
<tr><th scope="col">Line</th><th scope="col">Source</th></tr>
</thead>
<tbody>
@foreach ($lines as $index => $line)
<tr class="group hover:bg-zinc-900/80">
<td class="select-none border-r border-zinc-800 bg-zinc-900 px-4 text-right text-zinc-500">{{ $index + 1 }}</td>
<th scope="row" class="select-none border-r border-zinc-800 bg-zinc-900 px-4 text-right font-normal text-zinc-500">{{ $index + 1 }}</th>
<td class="whitespace-pre px-4 text-zinc-100"><code>{{ $line }}</code></td>
</tr>
@endforeach
@@ -1657,7 +1657,7 @@
<style>
[data-helpdesk-sidebar-cards] details > summary::-webkit-details-marker {
display: none;
}
[data-helpdesk-sidebar-cards] details > summary {
+1 -1
View File
@@ -125,7 +125,7 @@
config = { labels: [], datasets: [] };
}
new Chart(canvas, {
canvas.wmsChart = new Chart(canvas, {
type: type,
data: normaliseConfig(config, type),
options: optionsFor(type)
+1 -1
View File
@@ -77,7 +77,7 @@ function renderWmsCharts() {
},
];
new Chart(canvas, {
canvas.wmsChart = new Chart(canvas, {
type,
data: {
labels,
+1 -1
View File
@@ -125,7 +125,7 @@
config = { labels: [], datasets: [] };
}
new Chart(canvas, {
canvas.wmsChart = new Chart(canvas, {
type: type,
data: normaliseConfig(config, type),
options: optionsFor(type)
+1 -1
View File
@@ -23,7 +23,7 @@
}
code {
font-family: monospace, monospace;
font-family: monospace;
font-size: 1em
}
+8 -1
View File
@@ -9,7 +9,7 @@ sonar.exclusions=vendor/**,node_modules/**,storage/**,bootstrap/cache/**,public/
# S116: snake_case Livewire public properties intentionally mirror form/database fields.
# S4833: Deployer/Laravel module bootstraps intentionally load recipe/route files.
# Web title checks are not valid on Blade/Vue partials/components which are not standalone HTML documents.
sonar.issue.ignore.multicriteria=e1,e2,e3,e4,e5,e6,e7,e8
sonar.issue.ignore.multicriteria=e1,e2,e3,e4,e5,e6,e7,e8,e9,e10
sonar.issue.ignore.multicriteria.e1.ruleKey=php:S103
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.php
sonar.issue.ignore.multicriteria.e2.ruleKey=php:S1808
@@ -29,3 +29,10 @@ sonar.issue.ignore.multicriteria.e7.resourceKey=resources/css/app.css
# Empty module Sass entrypoints are intentional placeholders for module-owned assets.
sonar.issue.ignore.multicriteria.e8.ruleKey=css:S4667
sonar.issue.ignore.multicriteria.e8.resourceKey=Modules/*/Resources/assets/sass/app.scss
# Laravel global helper functions intentionally use snake_case to match framework conventions.
sonar.issue.ignore.multicriteria.e9.ruleKey=php:S100
sonar.issue.ignore.multicriteria.e9.resourceKey=Modules/*/Helpers/Helper.php
# Framework bootstrap/route files conventionally use require and are intentionally not converted to require_once.
sonar.issue.ignore.multicriteria.e10.ruleKey=php:S2003
sonar.issue.ignore.multicriteria.e10.resourceKey=**/{public/index.php,routes/*.php,deploy.php,tests/CreatesApplication.php}
+4 -3
View File
@@ -10,6 +10,7 @@ use PHPUnit\Framework\Attributes\BeforeClass;
abstract class DuskTestCase extends BaseTestCase
{
private const LOOPBACK = self::LOOPBACK;
use CreatesApplication;
/**
@@ -31,7 +32,7 @@ abstract class DuskTestCase extends BaseTestCase
if (! static::runningInSail()) {
static::ensureChromeDriverBinaryAlias();
static::startChromeDriver(['--port=9515']);
static::waitForTcpPort('127.0.0.1', 9515, 8.0, 'ChromeDriver');
static::waitForTcpPort(self::LOOPBACK, 9515, 8.0, 'ChromeDriver');
}
}
@@ -98,7 +99,7 @@ abstract class DuskTestCase extends BaseTestCase
$parts = parse_url($url);
$scheme = $parts['scheme'] ?? 'http';
$host = $parts['host'] ?? '127.0.0.1';
$host = $parts['host'] ?? self::LOOPBACK;
$port = (int) ($parts['port'] ?? ($scheme === 'https' ? 443 : 80));
$useExternalServer = filter_var(
@@ -191,7 +192,7 @@ abstract class DuskTestCase extends BaseTestCase
private static function availablePort(int $from, int $to): int
{
for ($port = $from; $port <= $to; $port++) {
if (! static::canConnect('127.0.0.1', $port)) {
if (! static::canConnect(self::LOOPBACK, $port)) {
return $port;
}
}
@@ -276,10 +276,4 @@ class PlatformAdministrationTest extends TestCase
/**
* Seed the test session with the matching CSRF token.
*/
private function withCsrfSession(): self
{
$this->withSession(['_token' => 'test-token']);
return $this;
}
}
@@ -314,10 +314,4 @@ class PlatformPriceCrudTest extends TestCase
/**
* Seed the test session with the matching CSRF token.
*/
private function withCsrfSession(): self
{
$this->withSession(['_token' => 'test-token']);
return $this;
}
}
@@ -217,10 +217,4 @@ class WarehouseCrudTest extends TestCase
/**
* Seed the test session with the matching CSRF token.
*/
private function withCsrfSession(): self
{
$this->withSession(['_token' => 'test-token']);
return $this;
}
}