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
@@ -42,6 +42,7 @@ class AuditTrailController extends Controller
* Show the specified resource.
*
* @param int $id
*
* @return Renderable
*/
public function show($id)
@@ -53,6 +54,7 @@ class AuditTrailController extends Controller
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return Renderable
*/
public function edit($id)
@@ -64,6 +66,7 @@ class AuditTrailController extends Controller
* Update the specified resource in storage.
*
* @param int $id
*
* @return Renderable
*/
public function update(Request $request, $id)
@@ -75,6 +78,7 @@ class AuditTrailController extends Controller
* Remove the specified resource from storage.
*
* @param int $id
*
* @return Renderable
*/
public function destroy($id)
@@ -84,7 +84,8 @@ class AuditTrailServiceProvider extends ServiceProvider
module_path(ModuleInfo::name(), 'Config/config.php') => config_path(ModuleInfo::nameLower() . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path(ModuleInfo::name(), 'Config/config.php'), ModuleInfo::nameLower()
module_path(ModuleInfo::name(), 'Config/config.php'),
ModuleInfo::nameLower(),
);
}
@@ -273,7 +273,7 @@ class IsoCountriesSeeder extends Seeder
'iso_status' => 'official',
'source' => 'bundled-iso-3166-1',
'source_version' => '2026-06-15',
])
]),
);
}
}
@@ -63,7 +63,7 @@ class IsoCountrySubdivisionsSeeder extends Seeder
'last_synced_at' => $now,
'source' => 'bundled-bootstrap',
'source_version' => '2026-06-15',
]
],
);
}
}
-2
View File
@@ -1,8 +1,6 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Countries\Http\Controllers\CountriesController;
use Modules\Countries\Http\Controllers\CountrySyncController;
use Modules\Countries\Http\Controllers\ReferenceDataController;
@@ -67,6 +67,7 @@ class DocumentationCategory extends Model
* Active category scope.
*
* @param Builder<DocumentationCategory> $query
*
* @return Builder<DocumentationCategory>
*/
public function scopeActive(Builder $query): Builder
@@ -78,6 +79,7 @@ class DocumentationCategory extends Model
* Ordered category scope.
*
* @param Builder<DocumentationCategory> $query
*
* @return Builder<DocumentationCategory>
*/
public function scopeOrdered(Builder $query): Builder
@@ -102,6 +102,7 @@ class DocumentationDocument extends Model
* Published document scope.
*
* @param Builder<DocumentationDocument> $query
*
* @return Builder<DocumentationDocument>
*/
public function scopePublished(Builder $query): Builder
@@ -113,6 +114,7 @@ class DocumentationDocument extends Model
* Featured document scope.
*
* @param Builder<DocumentationDocument> $query
*
* @return Builder<DocumentationDocument>
*/
public function scopeFeatured(Builder $query): Builder
@@ -19,7 +19,7 @@ final class DocumentationServiceProvider extends ServiceProvider
$this->mergeConfigFrom(
module_path('Documentation', 'Config/config.php'),
'documentation'
'documentation',
);
}
@@ -18,6 +18,7 @@ class DocumentationModuleTest extends TestCase
* Add a CSRF token for projects that keep web middleware enabled during tests.
*
* @param array<string, mixed> $payload
*
* @return array<string, mixed>
*/
private function csrfPayload(array $payload): array
@@ -49,7 +49,7 @@ return new class extends Migration
'sort_order' => ($index + 1) * 10,
'created_at' => now(),
'updated_at' => now(),
]
],
);
}
}
@@ -89,7 +89,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
] as $row) {
Category::query()->updateOrCreate(
['company_id' => null, 'slug' => Str::slug($row['name'])],
$row + ['company_id' => null, 'slug' => Str::slug($row['name'])]
$row + ['company_id' => null, 'slug' => Str::slug($row['name'])],
);
}
}
@@ -119,7 +119,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
'color' => 'blue',
'description' => 'Default support team for triage, ownership and ticket routing.',
'is_default' => true,
]
],
);
Project::query()->updateOrCreate(
@@ -132,7 +132,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
'color' => 'indigo',
'description' => 'Default project for operational helpdesk tickets.',
'is_default' => true,
]
],
);
}
@@ -151,7 +151,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
'description' => 'Default Helpdesk workflow board covering new work through closure.',
'is_default' => true,
'sort_order' => 1,
]
],
);
$statuses = Status::query()
@@ -181,7 +181,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
] as $template) {
WorkflowTemplate::query()->updateOrCreate(
['name' => $template['name'], 'event' => $template['event']],
$template + ['text_body' => null, 'cc' => null, 'bcc' => null, 'is_active' => true]
$template + ['text_body' => null, 'cc' => null, 'bcc' => null, 'is_active' => true],
);
}
}
@@ -207,7 +207,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
'business_hours_only' => false,
'is_default' => true,
'is_active' => true,
]
],
);
CannedResponse::query()->updateOrCreate(
@@ -223,7 +223,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
'body' => '<p>Hello {{ requester.name }},</p><p>Thank you for the update on {{ ticket.reference }}. I am reviewing this now and will come back with the next action shortly.</p><p>Regards,<br>{{ agent.name }}</p>',
'is_active' => true,
'sort_order' => 10,
]
],
);
ChecklistTemplate::query()->updateOrCreate(
@@ -236,7 +236,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
'slug' => 'bug-triage-checklist',
'items' => ['Confirm reproduction steps', 'Check recent deployment/build', 'Identify affected tenant/company', 'Record fix or workaround'],
'is_active' => true,
]
],
);
foreach ([
@@ -245,7 +245,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
] as $tag) {
Tag::query()->updateOrCreate(
['company_id' => null, 'slug' => $tag['slug']],
$tag + ['company_id' => null]
$tag + ['company_id' => null],
);
}
@@ -267,7 +267,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
'release_channel' => 'core',
'description' => 'Default service record for WMS platform support tickets.',
'is_active' => true,
]
],
);
}
}
@@ -21,7 +21,7 @@ final class HelpdeskLivewireAssetsTest extends TestCase
self::assertLessThan(
strpos($layout, '@fluxScripts'),
strpos($layout, '@livewireScripts'),
'Livewire scripts must be loaded before Flux scripts so settings CRUD actions fire in the browser.'
'Livewire scripts must be loaded before Flux scripts so settings CRUD actions fire in the browser.',
);
}
}
@@ -7,6 +7,7 @@ namespace Modules\Helpdesk\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Gate;
use Modules\Helpdesk\Models\Ticket;
@@ -34,7 +35,7 @@ final class TicketAttachmentStoreController extends Controller
$uploadedFiles = $request->file('attachments', []);
$uploadedFiles = is_array($uploadedFiles) ? $uploadedFiles : [$uploadedFiles];
$uploadedFiles = array_values(array_filter($uploadedFiles, static fn ($file): bool => $file instanceof \Illuminate\Http\UploadedFile && $file->isValid()));
$uploadedFiles = array_values(array_filter($uploadedFiles, static fn ($file): bool => $file instanceof UploadedFile && $file->isValid()));
$attachments->storeMany($ticket, $uploadedFiles, (int) $user->id);
@@ -7,6 +7,7 @@ namespace Modules\Helpdesk\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Str;
@@ -74,7 +75,7 @@ final class TicketCommentStoreController extends Controller
$uploadedFiles = $request->file('attachments', []);
$uploadedFiles = is_array($uploadedFiles) ? $uploadedFiles : [$uploadedFiles];
$uploadedFiles = array_values(array_filter($uploadedFiles, static fn ($file): bool => $file instanceof \Illuminate\Http\UploadedFile && $file->isValid()));
$uploadedFiles = array_values(array_filter($uploadedFiles, static fn ($file): bool => $file instanceof UploadedFile && $file->isValid()));
$tickets->comment(
ticket: $ticket,
@@ -107,7 +107,7 @@ final class TicketControlsController extends Controller
(bool) ($validated['closure_internal'] ?? false),
[],
null,
'Closure comment'
'Closure comment',
);
$fresh = $this->freshTicketForAction($ticket);
+3 -3
View File
@@ -66,7 +66,7 @@ final class KanbanBoard extends Component
$workflow->dispatch(
$freshTicket,
$status->is_closed ? 'ticket.closed' : 'ticket.updated',
Auth::user()
Auth::user(),
);
$message = 'Ticket ' . $freshTicket->reference . ' moved from ' . $oldStatusName . ' to ' . $status->name . '.';
@@ -241,7 +241,7 @@ final class KanbanBoard extends Component
{
DB::table('helpdesk_kanban_board_statuses')->updateOrInsert(
['board_id' => $boardId, 'status_id' => $statusId],
['sort_order' => 999, 'updated_at' => now(), 'created_at' => now()]
['sort_order' => 999, 'updated_at' => now(), 'created_at' => now()],
);
}
@@ -266,7 +266,7 @@ final class KanbanBoard extends Component
'sort_order' => ($index + 1) * 10,
'created_at' => now(),
'updated_at' => now(),
]
],
);
}
}
@@ -6,6 +6,8 @@ namespace Modules\Helpdesk\Livewire;
use App\Models\User;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
@@ -824,9 +826,11 @@ final class SettingsManager extends Component
* which made every new Helpdesk settings CRUD form appear to do nothing.
*
* @template TModel of \Illuminate\Database\Eloquent\Model
*
* @param class-string<TModel> $modelClass
* @param int|string|null $id
* @param array<string, mixed> $data
*
* @return TModel
*/
private function persistSettingModel(string $modelClass, int|string|null $id, array $data): object
@@ -847,7 +851,7 @@ final class SettingsManager extends Component
$model = $modelClass::query()->create($data);
return $model;
} catch (\Illuminate\Database\QueryException $exception) {
} catch (QueryException $exception) {
throw ValidationException::withMessages([
'settings' => 'The record could not be saved. Check the slug is unique for this section/company and try again.',
]);
@@ -857,7 +861,7 @@ final class SettingsManager extends Component
/**
* Clear the default flag on every other record without generating invalid null-id SQL.
*
* @param class-string<\Illuminate\Database\Eloquent\Model> $modelClass
* @param class-string<Model> $modelClass
*/
private function clearOtherDefaults(string $modelClass, int|string|null $currentId, int|string|null $companyId = null): void
{
@@ -867,7 +871,7 @@ final class SettingsManager extends Component
$query->whereKeyNot((int) $currentId);
}
if (Schema::hasColumn((new $modelClass())->getTable(), 'company_id')) {
if (Schema::hasColumn((new $modelClass)->getTable(), 'company_id')) {
$query->where('company_id', filled($companyId) ? (int) $companyId : null);
}
@@ -907,6 +911,7 @@ final class SettingsManager extends Component
* Remove is_default before save when the database has not been migrated yet.
*
* @param array<string, mixed> $data
*
* @return array<string, mixed>
*/
private function guardDefaultColumn(string $table, array $data): array
@@ -52,7 +52,6 @@ final class TicketCreate extends Component
public bool $isSaving = false;
/**
* Validation rules are intentionally evaluated only when the user submits
* the form, not while rich-text/select widgets are synchronising.
+1 -3
View File
@@ -120,7 +120,6 @@ final class TicketShow extends Component
$this->dispatch('helpdesk-reply-added');
}
/**
* Refresh ticket aggregates and the time-log modal after the timer component starts or stops.
*/
@@ -211,7 +210,7 @@ final class TicketShow extends Component
$this->closureInternal,
[],
null,
'Closure comment'
'Closure comment',
);
$this->reset(['closureComment', 'closureInternal']);
@@ -398,7 +397,6 @@ final class TicketShow extends Component
]);
}
/**
* Get the first-response SLA headline for the SLA panel.
*/
+3 -2
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Models;
use App\Models\Company;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
@@ -23,10 +24,10 @@ final class Category extends Model
/** @var array<string, string> */
protected $casts = ['company_id' => 'integer', 'is_default' => 'boolean'];
/** @return BelongsTo<\App\Models\Company, Category> */
/** @return BelongsTo<Company, Category> */
public function company(): BelongsTo
{
return $this->belongsTo(\App\Models\Company::class, 'company_id');
return $this->belongsTo(Company::class, 'company_id');
}
/** @return HasMany<Ticket> */
+1 -4
View File
@@ -5,10 +5,10 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Builder;
final class Comment extends Model
{
@@ -89,13 +89,10 @@ final class Comment extends Model
}
/** @param Builder<Comment> $query */
public function scopeActive(Builder $query): Builder
{
return $query->whereNull('tombstoned_at');
}
}
+3 -2
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Models;
use App\Models\Company;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -23,10 +24,10 @@ final class Project extends Model
/** @var array<string, string> */
protected $casts = ['company_id' => 'integer', 'team_id' => 'integer', 'archived_at' => 'datetime', 'is_default' => 'boolean'];
/** @return BelongsTo<\App\Models\Company, Project> */
/** @return BelongsTo<Company, Project> */
public function company(): BelongsTo
{
return $this->belongsTo(\App\Models\Company::class, 'company_id');
return $this->belongsTo(Company::class, 'company_id');
}
/** @return BelongsTo<Team, Project> */
+3 -2
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Models;
use App\Models\Company;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -27,10 +28,10 @@ final class Team extends Model
'is_default' => 'boolean',
];
/** @return BelongsTo<\App\Models\Company, Team> */
/** @return BelongsTo<Company, Team> */
public function company(): BelongsTo
{
return $this->belongsTo(\App\Models\Company::class, 'company_id');
return $this->belongsTo(Company::class, 'company_id');
}
/** @return HasMany<Project> */
@@ -42,7 +42,7 @@ final class HelpdeskServiceProvider extends ServiceProvider
$this->mergeConfigFrom(
module_path(ModuleInfo::name(), 'Config/config.php'),
ModuleInfo::nameLower()
ModuleInfo::nameLower(),
);
}
+2 -2
View File
@@ -5,10 +5,10 @@ declare(strict_types=1);
use Illuminate\Support\Facades\Route;
use Modules\Helpdesk\Http\Controllers\AttachmentDownloadController;
use Modules\Helpdesk\Http\Controllers\HelpdeskController;
use Modules\Helpdesk\Http\Controllers\TicketControlsController;
use Modules\Helpdesk\Http\Controllers\TicketAttachmentStoreController;
use Modules\Helpdesk\Http\Controllers\TicketCommentDeleteController;
use Modules\Helpdesk\Http\Controllers\TicketCommentStoreController;
use Modules\Helpdesk\Http\Controllers\TicketAttachmentStoreController;
use Modules\Helpdesk\Http\Controllers\TicketControlsController;
use Modules\Helpdesk\Http\Controllers\TicketStoreController;
use Modules\Helpdesk\Http\Controllers\TicketTimeLogController;
use Modules\Helpdesk\Http\Controllers\WorkflowOpenController;
@@ -26,7 +26,7 @@ final class AgentAssignmentService
->selectRaw('count(*)')
->whereColumn('helpdesk_tickets.agent_id', 'users.id')
->whereNull('helpdesk_tickets.completed_at'),
'open_helpdesk_tickets_count'
'open_helpdesk_tickets_count',
);
if ($categoryId !== null) {
@@ -20,6 +20,7 @@ final class GitWebhookIngestionService
* Persist supported Git provider commits and link them to matching Helpdesk ticket references.
*
* @param array<string, mixed> $payload
*
* @return array{status: string, message: string, commit_count: int, linked_count: int, ignored_count: int}
*/
public function ingest(GitRepository $repository, array $payload, string $provider, ?string $deliveryId, ?string $event): array
@@ -76,7 +77,7 @@ final class GitWebhookIngestionService
'message' => $message,
'url' => $url,
'committed_at' => $committedAt,
]
],
);
$commitCount++;
@@ -171,6 +172,7 @@ final class GitWebhookIngestionService
/**
* @param array<string, mixed> $payload
*
* @return array<int, array<string, mixed>>
*/
private function commitsFromPayload(array $payload): array
+3 -2
View File
@@ -5,8 +5,9 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Services;
use App\Models\User;
use Modules\Helpdesk\Models\SlaPolicy;
use Illuminate\Support\Carbon;
use Modules\Helpdesk\Models\Comment;
use Modules\Helpdesk\Models\SlaPolicy;
use Modules\Helpdesk\Models\Ticket;
use Modules\Helpdesk\Models\TicketSlaEvent;
@@ -89,7 +90,7 @@ final class SlaService
private function markFirstResponse(Ticket $ticket, mixed $respondedAt, ?User $actor = null): void
{
$respondedAt = $respondedAt instanceof \Illuminate\Support\Carbon
$respondedAt = $respondedAt instanceof Carbon
? $respondedAt
: now();
+1 -1
View File
@@ -5,8 +5,8 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Services;
use App\Models\User;
use Illuminate\Http\UploadedFile;
use Illuminate\Database\QueryException;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Tests\Browser;
use Laravel\Dusk\Browser;
use Modules\Helpdesk\Models\CannedResponse;
use Modules\Helpdesk\Models\Comment;
use Modules\Helpdesk\Tests\Concerns\BuildsHelpdeskFixtures;
use Tests\DuskTestCase;
@@ -69,7 +68,6 @@ final class HelpdeskTicketBrowserTest extends DuskTestCase
'is_internal' => false,
]);
Comment::query()->create([
'ticket_id' => $ticket->id,
'user_id' => $user->id,
@@ -21,7 +21,7 @@ final class HelpdeskLivewireAssetsTest extends TestCase
self::assertLessThan(
strpos($layout, '@fluxScripts'),
strpos($layout, '@livewireScripts'),
'Livewire scripts must be loaded before Flux scripts so settings CRUD actions fire in the browser.'
'Livewire scripts must be loaded before Flux scripts so settings CRUD actions fire in the browser.',
);
}
}
@@ -214,7 +214,7 @@ final class SettingsCrudTest extends TestCase
$checklist = ChecklistTemplate::query()->where('slug', 'release-checklist')->firstOrFail();
Livewire::test(SettingsManager::class)
->call('editChecklistTemplate', $checklist->id)
->set('checklistTemplateForm.items_text', "Updated item")
->set('checklistTemplateForm.items_text', 'Updated item')
->call('saveChecklistTemplate')
->assertHasNoErrors();
$this->assertDatabaseHas('helpdesk_checklist_templates', ['id' => $checklist->id]);
@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace Modules\Helpdesk\Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\Company;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
@@ -13,6 +13,7 @@ use Livewire\Livewire;
use Modules\Helpdesk\Livewire\TicketShow;
use Modules\Helpdesk\Models\Attachment;
use Modules\Helpdesk\Models\Comment;
use Modules\Helpdesk\Services\TicketService;
use Modules\Helpdesk\Tests\Concerns\BuildsHelpdeskFixtures;
use Tests\TestCase;
@@ -69,7 +70,6 @@ final class TicketConversationTest extends TestCase
]);
}
public function test_comment_post_endpoint_creates_lotus_identity_and_search_text(): void
{
$fixtures = $this->seedLookupData();
@@ -98,7 +98,7 @@ final class TicketConversationTest extends TestCase
$fixtures = $this->seedLookupData();
$owner = $this->user();
$ticket = $this->ticket(['owner' => $owner, 'status_id' => $fixtures['open']->id, 'priority_id' => $fixtures['normal']->id]);
$parent = app(\Modules\Helpdesk\Services\TicketService::class)->comment($ticket, $owner, '<p>Parent response</p>');
$parent = app(TicketService::class)->comment($ticket, $owner, '<p>Parent response</p>');
$this->actingAs($owner)
->post(route('helpdesk.tickets.comments.store', $ticket), [
@@ -115,8 +115,6 @@ final class TicketConversationTest extends TestCase
self::assertSame('RE: Parent response', $reply->subject);
}
public function test_existing_ticket_accepts_multiple_supporting_file_attachments(): void
{
Storage::fake((string) config('helpdesk.disk', 'public'));
@@ -187,7 +185,7 @@ final class TicketConversationTest extends TestCase
$admin = $this->user(['company_id' => $company->id, 'is_platform_admin' => true]);
$owner = $this->user(['company_id' => $company->id]);
$ticket = $this->ticket(['owner' => $owner, 'status_id' => $fixtures['open']->id, 'priority_id' => $fixtures['normal']->id]);
$comment = app(\Modules\Helpdesk\Services\TicketService::class)->comment($ticket, $owner, '<p>Delete me</p>');
$comment = app(TicketService::class)->comment($ticket, $owner, '<p>Delete me</p>');
$this->actingAs($admin)
->delete(route('helpdesk.tickets.comments.destroy', [$ticket, $comment]))
@@ -44,7 +44,6 @@ final class TicketCrudTest extends TestCase
]);
}
public function test_ticket_create_does_not_validate_before_submit(): void
{
$this->seedLookupData();
@@ -26,6 +26,7 @@ final class TicketTimerButtonSizeFilesTest extends TestCase
self::assertStringNotContainsString('px-3 py-1.5 text-xs', $view);
self::assertStringNotContainsString('ticket-timer.js', $view);
}
/**
* Ensure the active timer action also remains readable and single-line.
*/
@@ -16,7 +16,7 @@ class TicketTimerFilesTest extends TestCase
$this->assertStringStartsWith('<div', $view);
$this->assertFalse(
str_starts_with($view, '<style'),
'The ticket timer Livewire view must not start with a <style> tag.'
'The ticket timer Livewire view must not start with a <style> tag.',
);
}
@@ -32,7 +32,7 @@ class StripeWebhookController extends Controller
'description' => 'Stripe payment received',
'paid_at' => now(),
'metadata' => $intent,
]
],
);
}
}
@@ -29,7 +29,7 @@ class PlatformSeeder extends Seeder
'timezone' => 'Europe/London',
'is_system_company' => true,
'billing_email' => 'mark.gregory@mpba.co.uk',
]
],
);
$user = User::updateOrCreate(
@@ -55,7 +55,7 @@ class PlatformSeeder extends Seeder
'is_company_admin' => true,
'status' => 'active',
'email_verified_at' => now(),
]
],
);
$user->assignRole($role);
$warehouse = Warehouse::firstOrNew([
@@ -72,7 +72,7 @@ class PlatformSeeder extends Seeder
WarehouseValidationRule::updateOrCreate(
['warehouse_id' => $warehouse->id, 'rule_key' => 'stock.location.required'],
['name' => 'Stock location required', 'severity' => 'error', 'is_active' => true, 'configuration' => ['required' => true]]
['name' => 'Stock location required', 'severity' => 'error', 'is_active' => true, 'configuration' => ['required' => true]],
);
}
}
@@ -124,7 +124,7 @@ final class PricingDatabaseSeeder extends Seeder
DB::table('platform_prices')->updateOrInsert(
['code' => $plan['code']],
$payload
$payload,
);
}
}
@@ -84,7 +84,8 @@ class PricingServiceProvider extends ServiceProvider
module_path(ModuleInfo::name(), 'Config/config.php') => config_path(ModuleInfo::nameLower() . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path(ModuleInfo::name(), 'Config/config.php'), ModuleInfo::nameLower()
module_path(ModuleInfo::name(), 'Config/config.php'),
ModuleInfo::nameLower(),
);
}
@@ -6,7 +6,6 @@ use App\Http\Controllers\Controller;
use Modules\Warehouse\app\Models\Warehouse;
use Modules\Warehouse\app\Models\WarehouseValidationRule;
class WarehouseDashboardController extends Controller
{
/**
+1 -1
View File
@@ -21,7 +21,7 @@ class Warehouse extends Model
];
protected $casts = [
'settings' => 'array'
'settings' => 'array',
];
protected static function booted(): 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()
@@ -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,7 +176,7 @@ 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)) {
@@ -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)) {
@@ -261,6 +261,7 @@ final class DashboardChartService
/**
* @param array<int, string> $labels
*
* @return array<string, int>
*/
private function emptySeries(array $labels): array
@@ -289,6 +290,7 @@ final class DashboardChartService
/**
* @param array<int, string> $labels
* @param array<int, int> $data
*
* @return array<string, mixed>
*/
private function lineChart(array $labels, array $data, string $label): array
@@ -307,6 +309,7 @@ final class DashboardChartService
/**
* @param array<int, string> $labels
* @param array<int, int> $data
*
* @return array<string, mixed>
*/
private function barChart(array $labels, array $data, string $label): array
@@ -324,6 +327,7 @@ final class DashboardChartService
/**
* @param array<int, string> $labels
* @param array<int, int> $data
*
* @return array<string, mixed>
*/
private function doughnutChart(array $labels, array $data, string $label): array
+1 -1
View File
@@ -18,7 +18,7 @@ return Application::configure(basePath: dirname(__DIR__))
headers: Request::HEADER_X_FORWARDED_FOR
| Request::HEADER_X_FORWARDED_HOST
| Request::HEADER_X_FORWARDED_PORT
| Request::HEADER_X_FORWARDED_PROTO
| Request::HEADER_X_FORWARDED_PROTO,
);
$middleware->alias([
+1 -1
View File
@@ -69,7 +69,7 @@ return [
'prefix' => env(
'HORIZON_PREFIX',
Str::slug(env('APP_NAME', 'laravel'), '_').'_horizon:'
Str::slug(env('APP_NAME', 'laravel'), '_') . '_horizon:',
),
/*
+58 -1
View File
@@ -1,3 +1,60 @@
{
"preset": "laravel"
"preset": "laravel",
"exclude": [
"bootstrap/cache",
"storage",
"public/build",
"node_modules"
],
"notName": [
"_ide_helper.php",
"_ide_helper_models.php",
".phpstorm.meta.php"
],
"rules": {
"Pint/phpdoc_type_annotations_only": false,
"no_superfluous_phpdoc_tags": false,
"array_syntax": {
"syntax": "short"
},
"binary_operator_spaces": {
"default": "single_space"
},
"cast_spaces": {
"space": "single"
},
"concat_space": {
"spacing": "one"
},
"method_argument_space": {
"on_multiline": "ensure_fully_multiline",
"attribute_placement": "standalone"
},
"no_unused_imports": true,
"ordered_imports": {
"sort_algorithm": "alpha"
},
"phpdoc_align": {
"align": "vertical"
},
"phpdoc_order": {
"order": [
"param",
"return",
"throws"
]
},
"phpdoc_separation": true,
"phpdoc_trim": true,
"single_import_per_statement": true,
"single_line_after_imports": true,
"single_line_comment_spacing": true,
"trailing_comma_in_multiline": {
"elements": [
"arrays",
"arguments",
"parameters"
]
}
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ class AuthBrowserTest extends DuskTestCase
$browser->waitUntil(
'window.location.pathname === "/" || window.location.pathname === "/login" || ! document.querySelector(".wms-app-shell")',
15
15,
);
});
}
@@ -54,7 +54,7 @@ if (link) {
window.location.href = expectedPath;
}
JS,
json_encode($path, JSON_THROW_ON_ERROR)
json_encode($path, JSON_THROW_ON_ERROR),
));
$browser->waitForLocation($path, 15);
@@ -161,6 +161,7 @@ trait InteractsWithWmsData
/**
* @param array<int, string> $features
*
* @return array<string, mixed>
*/
private function platformPriceAttributes(
-1
View File
@@ -3,7 +3,6 @@
namespace Tests\Browser;
use Laravel\Dusk\Browser;
use Modules\Warehouse\app\Models\WarehouseValidationRule;
use Tests\Browser\Concerns\InteractsWithWmsBrowser;
use Tests\Browser\Concerns\InteractsWithWmsData;
use Tests\DuskTestCase;
+5 -6
View File
@@ -40,7 +40,7 @@ abstract class DuskTestCase extends BaseTestCase
*/
protected function driver(): RemoteWebDriver
{
$options = (new ChromeOptions())->addArguments([
$options = (new ChromeOptions)->addArguments([
'--disable-gpu',
'--headless=new',
'--window-size=1920,1080',
@@ -56,8 +56,8 @@ abstract class DuskTestCase extends BaseTestCase
$_ENV['DUSK_DRIVER_URL'] ?? 'http://127.0.0.1:9515',
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY,
$options
)
$options,
),
);
}
@@ -191,12 +191,11 @@ abstract class DuskTestCase extends BaseTestCase
&& $path !== $expected
&& ! str_ends_with($path, '.zip')
&& ! str_ends_with($path, '.txt');
}
},
));
usort($candidates, static function (string $left, string $right): int {
$score = static fn (string $path): int =>
str_contains($path, 'mac-arm64') ? 0
$score = static fn (string $path): int => str_contains($path, 'mac-arm64') ? 0
: (str_contains($path, 'mac-arm') ? 1
: (str_contains($path, 'mac') ? 2 : 3));
@@ -242,6 +242,7 @@ class PlatformAdministrationTest extends TestCase
/**
* @param array<string, mixed> $overrides
*
* @return array<string, mixed>
*/
private function pricePayload(array $overrides = []): array
@@ -267,6 +268,7 @@ class PlatformAdministrationTest extends TestCase
* Return payload with a valid test CSRF token.
*
* @param array<string, mixed> $payload
*
* @return array<string, mixed>
*/
private function csrfPayload(array $payload = []): array
@@ -256,6 +256,7 @@ class PlatformPriceCrudTest extends TestCase
/**
* @param array<string, mixed> $overrides
*
* @return array<string, mixed>
*/
private function pricePayload(array $overrides = []): array
@@ -302,6 +303,7 @@ class PlatformPriceCrudTest extends TestCase
* Return payload with a valid test CSRF token.
*
* @param array<string, mixed> $payload
*
* @return array<string, mixed>
*/
private function csrfPayload(array $payload = []): array
@@ -206,6 +206,7 @@ class WarehouseCrudTest extends TestCase
* Return payload with a valid test CSRF token.
*
* @param array<string, mixed> $payload
*
* @return array<string, mixed>
*/
private function csrfPayload(array $payload = []): array
+4 -3
View File
@@ -2,6 +2,7 @@
namespace Tests;
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Testing\TestResponse;
@@ -30,9 +31,9 @@ abstract class TestCase extends BaseTestCase
$this->withoutMiddleware(ValidateCsrfToken::class);
}
if (class_exists(\App\Http\Middleware\VerifyCsrfToken::class)) {
\App\Http\Middleware\VerifyCsrfToken::except(['*']);
$this->withoutMiddleware(\App\Http\Middleware\VerifyCsrfToken::class);
if (class_exists(VerifyCsrfToken::class)) {
VerifyCsrfToken::except(['*']);
$this->withoutMiddleware(VerifyCsrfToken::class);
}
}