From 37bb7354fa409dc3a725e4b158648132513e0484 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Fri, 20 Nov 2026 07:19:23 +0000 Subject: [PATCH] new design with nice layout --- app/Console/Commands/CreateAdmin.php | 45 ++++++++--- app/Http/Controllers/Auth/LoginController.php | 36 ++++++--- app/Http/Middleware/EnsureAdmin.php | 12 ++- app/Livewire/Admin/Dashboard.php | 18 +++-- app/Livewire/Admin/Enquiries.php | 40 +++++++--- app/Livewire/Admin/Sections.php | 74 ++++++++++++++----- app/Livewire/Admin/Settings.php | 42 ++++++++--- app/Livewire/ContactForm.php | 26 +++++-- app/Models/ContactEnquiry.php | 14 +++- app/Models/SiteSection.php | 14 +++- app/Models/SiteSetting.php | 8 +- composer.json | 1 + .../2026_11_19_000001_create_cms_tables.php | 44 ++++++++--- database/seeders/DatabaseSeeder.php | 11 ++- database/seeders/SiteContentSeeder.php | 25 ++++--- routes/web.php | 21 +++--- tests/Feature/AbsdevBrandAndHomeTest.php | 26 +++++-- tests/Feature/SiteExperienceTest.php | 65 ++++++++++------ 18 files changed, 381 insertions(+), 141 deletions(-) diff --git a/app/Console/Commands/CreateAdmin.php b/app/Console/Commands/CreateAdmin.php index 5c09108..4aded4a 100644 --- a/app/Console/Commands/CreateAdmin.php +++ b/app/Console/Commands/CreateAdmin.php @@ -1,18 +1,39 @@ argument('email'); - if (!filter_var($email,FILTER_VALIDATE_EMAIL)) { $this->error('Invalid email address.'); return self::FAILURE; } - $password=$this->secret('Password (minimum 12 characters)'); - if (!is_string($password) || strlen($password)<12) { $this->error('Password must be at least 12 characters.'); return self::FAILURE; } - $user=User::firstOrNew(['email'=>$email]); - if (!$user->exists) $user->name=$this->ask('Administrator name','Administrator'); - $user->password=$password; $user->is_admin=true; $user->save(); - $this->info('Administrator account ready.'); return self::SUCCESS; + +class CreateAdmin extends Command +{ + protected $signature = 'absdev:create-admin {email}'; + + protected $description = 'Create or promote an administrator (password entered securely)'; + + public function handle(): int + { + $email = $this->argument('email'); + if (! filter_var($email, FILTER_VALIDATE_EMAIL)) { + $this->error('Invalid email address.'); + + return self::FAILURE; + } + $password = $this->secret('Password (minimum 12 characters)'); + if (! is_string($password) || strlen($password) < 12) { + $this->error('Password must be at least 12 characters.'); + + return self::FAILURE; + } + $user = User::firstOrNew(['email' => $email]); + if (! $user->exists) { + $user->name = $this->ask('Administrator name', 'Administrator'); + } + $user->password = $password; + $user->is_admin = true; + $user->save(); + $this->info('Administrator account ready.'); + + return self::SUCCESS; } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 7f601b3..0022356 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -1,20 +1,36 @@ validate(['email'=>'required|email','password'=>'required|string']); - if (!Auth::attempt([...$credentials,'is_admin'=>true],$request->boolean('remember'))) { - throw ValidationException::withMessages(['email'=>'Invalid administrator credentials.']); - } - $request->session()->regenerate(); return redirect()->intended(route('admin.dashboard')); + +class LoginController extends Controller +{ + public function show() + { + return view('auth.login'); } - public function logout(Request $request) { - Auth::logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); + + public function login(Request $request) + { + $credentials = $request->validate(['email' => 'required|email', 'password' => 'required|string']); + if (! Auth::attempt([...$credentials, 'is_admin' => true], $request->boolean('remember'))) { + throw ValidationException::withMessages(['email' => 'Invalid administrator credentials.']); + } + $request->session()->regenerate(); + + return redirect()->intended(route('admin.dashboard')); + } + + public function logout(Request $request) + { + Auth::logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + return redirect()->route('login'); } } diff --git a/app/Http/Middleware/EnsureAdmin.php b/app/Http/Middleware/EnsureAdmin.php index 8631b0f..3a2f914 100644 --- a/app/Http/Middleware/EnsureAdmin.php +++ b/app/Http/Middleware/EnsureAdmin.php @@ -1,11 +1,17 @@ user()?->is_admin,403); + +class EnsureAdmin +{ + public function handle(Request $request, Closure $next): Response + { + abort_unless($request->user()?->is_admin, 403); + return $next($request); } } diff --git a/app/Livewire/Admin/Dashboard.php b/app/Livewire/Admin/Dashboard.php index c496bc2..cd09f46 100644 --- a/app/Livewire/Admin/Dashboard.php +++ b/app/Livewire/Admin/Dashboard.php @@ -1,15 +1,19 @@ ContactEnquiry::count(), 'unreadEnquiries'=>ContactEnquiry::where('is_read',false)->count(), - 'sectionCount'=>SiteSection::count(), 'publishedSections'=>SiteSection::where('is_visible',true)->count(), - 'recentEnquiries'=>ContactEnquiry::latest()->limit(5)->get(), - ])->layout('layouts.admin', ['title'=>'Overview']); + 'totalEnquiries' => ContactEnquiry::count(), 'unreadEnquiries' => ContactEnquiry::where('is_read', false)->count(), + 'sectionCount' => SiteSection::count(), 'publishedSections' => SiteSection::where('is_visible', true)->count(), + 'recentEnquiries' => ContactEnquiry::latest()->limit(5)->get(), + ])->layout('layouts.admin', ['title' => 'Overview']); } } diff --git a/app/Livewire/Admin/Enquiries.php b/app/Livewire/Admin/Enquiries.php index 68083b6..a306770 100644 --- a/app/Livewire/Admin/Enquiries.php +++ b/app/Livewire/Admin/Enquiries.php @@ -1,17 +1,39 @@ resetPage(); } - public function markRead(int $id): void { ContactEnquiry::findOrFail($id)->update(['is_read'=>true]); } - public function delete(int $id): void { ContactEnquiry::findOrFail($id)->delete(); } - public function render() { - $query=ContactEnquiry::latest(); - if ($this->filter==='unread') $query->where('is_read',false); - return view('livewire.admin.enquiries',['enquiries'=>$query->paginate(12)])->layout('layouts.admin',['title'=>'Enquiries']); + + public string $filter = 'all'; + + public function updatingFilter(): void + { + $this->resetPage(); + } + + public function markRead(int $id): void + { + ContactEnquiry::findOrFail($id)->update(['is_read' => true]); + } + + public function delete(int $id): void + { + ContactEnquiry::findOrFail($id)->delete(); + } + + public function render() + { + $query = ContactEnquiry::latest(); + if ($this->filter === 'unread') { + $query->where('is_read', false); + } + + return view('livewire.admin.enquiries', ['enquiries' => $query->paginate(12)])->layout('layouts.admin', ['title' => 'Enquiries']); } } diff --git a/app/Livewire/Admin/Sections.php b/app/Livewire/Admin/Sections.php index ac3e8b0..eda1338 100644 --- a/app/Livewire/Admin/Sections.php +++ b/app/Livewire/Admin/Sections.php @@ -1,35 +1,75 @@ editingId=$s->id; - foreach (['key','eyebrow','title','body','button_label','button_url','is_visible','sort_order'] as $field) $this->$field=$s->$field ?? (is_bool($this->$field) ? false : ''); + + public function edit(int $id): void + { + $s = SiteSection::findOrFail($id); + $this->editingId = $s->id; + foreach (['key', 'eyebrow', 'title', 'body', 'button_label', 'button_url', 'is_visible', 'sort_order'] as $field) { + $this->$field = $s->$field ?? (is_bool($this->$field) ? false : ''); + } } - public function add(): void { $this->reset(['editingId','key','eyebrow','title','body','button_label','button_url','sort_order']); $this->is_visible=true; } - public function save(): void { - $data=$this->validate([ - 'key'=>['required','alpha_dash','max:80', Rule::unique('site_sections','key')->ignore($this->editingId)], - 'eyebrow'=>'nullable|string|max:255','title'=>'required|string|max:255','body'=>'nullable|string|max:5000', - 'button_label'=>'nullable|string|max:100','button_url'=>'nullable|string|max:500', - 'is_visible'=>'boolean','sort_order'=>'integer|min:0|max:999', + + public function add(): void + { + $this->reset(['editingId', 'key', 'eyebrow', 'title', 'body', 'button_label', 'button_url', 'sort_order']); + $this->is_visible = true; + } + + public function save(): void + { + $data = $this->validate([ + 'key' => ['required', 'alpha_dash', 'max:80', Rule::unique('site_sections', 'key')->ignore($this->editingId)], + 'eyebrow' => 'nullable|string|max:255', 'title' => 'required|string|max:255', 'body' => 'nullable|string|max:5000', + 'button_label' => 'nullable|string|max:100', 'button_url' => 'nullable|string|max:500', + 'is_visible' => 'boolean', 'sort_order' => 'integer|min:0|max:999', ]); - SiteSection::updateOrCreate(['id'=>$this->editingId], $data); - $this->add(); session()->flash('status','Section saved successfully.'); + SiteSection::updateOrCreate(['id' => $this->editingId], $data); + $this->add(); + session()->flash('status', 'Section saved successfully.'); + } + + public function toggle(int $id): void + { + $s = SiteSection::findOrFail($id); + $s->update(['is_visible' => ! $s->is_visible]); + } + + public function delete(int $id): void + { + SiteSection::findOrFail($id)->delete(); + if ($this->editingId === $id) { + $this->add(); + } + } + + public function render() + { + return view('livewire.admin.sections', ['sections' => SiteSection::orderBy('sort_order')->get()])->layout('layouts.admin', ['title' => 'Page sections']); } - public function toggle(int $id): void { $s=SiteSection::findOrFail($id); $s->update(['is_visible'=>!$s->is_visible]); } - public function delete(int $id): void { SiteSection::findOrFail($id)->delete(); if ($this->editingId===$id) $this->add(); } - public function render() { return view('livewire.admin.sections',['sections'=>SiteSection::orderBy('sort_order')->get()])->layout('layouts.admin',['title'=>'Page sections']); } } diff --git a/app/Livewire/Admin/Settings.php b/app/Livewire/Admin/Settings.php index 642a04b..f8f8e07 100644 --- a/app/Livewire/Admin/Settings.php +++ b/app/Livewire/Admin/Settings.php @@ -1,15 +1,39 @@ $key=SiteSetting::where('key',$key)->value('value') ?? ''; } - public function save(): void { - $data=$this->validate(['site_name'=>'required|string|max:100','email'=>'required|email|max:255', - 'footer_tagline'=>'nullable|string|max:255','location'=>'nullable|string|max:255']); - foreach ($data as $key=>$value) SiteSetting::updateOrCreate(['key'=>$key],['value'=>$value]); - session()->flash('status','Settings updated.'); + +class Settings extends Component +{ + public string $site_name = ''; + + public string $email = ''; + + public string $footer_tagline = ''; + + public string $location = ''; + + public function mount(): void + { + foreach (['site_name', 'email', 'footer_tagline', 'location'] as $key) { + $this->$key = SiteSetting::where('key', $key)->value('value') ?? ''; + } + } + + public function save(): void + { + $data = $this->validate(['site_name' => 'required|string|max:100', 'email' => 'required|email|max:255', + 'footer_tagline' => 'nullable|string|max:255', 'location' => 'nullable|string|max:255']); + foreach ($data as $key => $value) { + SiteSetting::updateOrCreate(['key' => $key], ['value' => $value]); + } + session()->flash('status', 'Settings updated.'); + } + + public function render() + { + return view('livewire.admin.settings')->layout('layouts.admin', ['title' => 'Site settings']); } - public function render() { return view('livewire.admin.settings')->layout('layouts.admin',['title'=>'Site settings']); } } diff --git a/app/Livewire/ContactForm.php b/app/Livewire/ContactForm.php index bc3dffd..9fe8776 100644 --- a/app/Livewire/ContactForm.php +++ b/app/Livewire/ContactForm.php @@ -1,5 +1,7 @@ validate(['name'=>'required|string|max:120','email'=>'required|email|max:255','company'=>'nullable|string|max:120', - 'service'=>'nullable|string|max:100','message'=>'required|string|min:10|max:5000','website'=>'nullable|max:0']); - $enquiry = ContactEnquiry::create($this->only(['name','email','company','service','message'])); - $this->reset(['name','email','company','service','message']); + $this->validate(['name' => 'required|string|max:120', 'email' => 'required|email|max:255', 'company' => 'nullable|string|max:120', + 'service' => 'nullable|string|max:100', 'message' => 'required|string|min:10|max:5000', 'website' => 'nullable|max:0']); + $enquiry = ContactEnquiry::create($this->only(['name', 'email', 'company', 'service', 'message'])); + $this->reset(['name', 'email', 'company', 'service', 'message']); $this->submitted = true; defer(fn () => $this->notifyByEmail($enquiry))->always(); @@ -69,5 +80,8 @@ class ContactForm extends Component { } } - public function render() { return view('livewire.contact-form'); } + public function render() + { + return view('livewire.contact-form'); + } } diff --git a/app/Models/ContactEnquiry.php b/app/Models/ContactEnquiry.php index e3c65b9..fa66b6e 100644 --- a/app/Models/ContactEnquiry.php +++ b/app/Models/ContactEnquiry.php @@ -1,7 +1,15 @@ 'boolean']; } + +class ContactEnquiry extends Model +{ + protected $fillable = ['name', 'email', 'company', 'service', 'message', 'is_read']; + + protected function casts(): array + { + return ['is_read' => 'boolean']; + } } diff --git a/app/Models/SiteSection.php b/app/Models/SiteSection.php index bec0344..9b34731 100644 --- a/app/Models/SiteSection.php +++ b/app/Models/SiteSection.php @@ -1,7 +1,15 @@ 'boolean','sort_order'=>'integer']; } + +class SiteSection extends Model +{ + protected $fillable = ['key', 'eyebrow', 'title', 'body', 'button_label', 'button_url', 'is_visible', 'sort_order']; + + protected function casts(): array + { + return ['is_visible' => 'boolean', 'sort_order' => 'integer']; + } } diff --git a/app/Models/SiteSetting.php b/app/Models/SiteSetting.php index 3071e8f..773c767 100644 --- a/app/Models/SiteSetting.php +++ b/app/Models/SiteSetting.php @@ -1,4 +1,10 @@ $table->boolean('is_admin')->default(false)); Schema::create('site_sections', function (Blueprint $table) { - $table->id(); $table->string('key')->unique(); $table->string('eyebrow')->nullable(); - $table->string('title'); $table->text('body')->nullable(); $table->string('button_label')->nullable(); - $table->string('button_url')->nullable(); $table->boolean('is_visible')->default(true); - $table->unsignedInteger('sort_order')->default(0); $table->timestamps(); + $table->id(); + $table->string('key')->unique(); + $table->string('eyebrow')->nullable(); + $table->string('title'); + $table->text('body')->nullable(); + $table->string('button_label')->nullable(); + $table->string('button_url')->nullable(); + $table->boolean('is_visible')->default(true); + $table->unsignedInteger('sort_order')->default(0); + $table->timestamps(); }); Schema::create('site_settings', function (Blueprint $table) { - $table->id(); $table->string('key')->unique(); $table->text('value')->nullable(); $table->timestamps(); + $table->id(); + $table->string('key')->unique(); + $table->text('value')->nullable(); + $table->timestamps(); }); Schema::create('contact_enquiries', function (Blueprint $table) { - $table->id(); $table->string('name'); $table->string('email'); $table->string('company')->nullable(); - $table->string('service')->nullable(); $table->text('message'); $table->boolean('is_read')->default(false); + $table->id(); + $table->string('name'); + $table->string('email'); + $table->string('company')->nullable(); + $table->string('service')->nullable(); + $table->text('message'); + $table->boolean('is_read')->default(false); $table->timestamps(); }); } - public function down(): void { - Schema::dropIfExists('contact_enquiries'); Schema::dropIfExists('site_settings'); - Schema::dropIfExists('site_sections'); Schema::table('users', fn (Blueprint $table) => $table->dropColumn('is_admin')); + + public function down(): void + { + Schema::dropIfExists('contact_enquiries'); + Schema::dropIfExists('site_settings'); + Schema::dropIfExists('site_sections'); + Schema::table('users', fn (Blueprint $table) => $table->dropColumn('is_admin')); } }; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 7eceb25..5e67ffd 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -1,4 +1,13 @@ call(SiteContentSeeder::class); } } + +class DatabaseSeeder extends Seeder +{ + public function run(): void + { + $this->call(SiteContentSeeder::class); + } +} diff --git a/database/seeders/SiteContentSeeder.php b/database/seeders/SiteContentSeeder.php index 91d6bde..4b3ba31 100644 --- a/database/seeders/SiteContentSeeder.php +++ b/database/seeders/SiteContentSeeder.php @@ -1,22 +1,27 @@ [$key,$eyebrow,$title,$body,$button,$url]) { - SiteSection::firstOrCreate(['key'=>$key], ['eyebrow'=>$eyebrow,'title'=>$title,'body'=>$body,'button_label'=>$button,'button_url'=>$url,'sort_order'=>$i]); + SiteSection::firstOrCreate(['key' => $key], ['eyebrow' => $eyebrow, 'title' => $title, 'body' => $body, 'button_label' => $button, 'button_url' => $url, 'sort_order' => $i]); } - foreach (['site_name'=>'ABSDEV','email'=>'hello@absdev.net','footer_tagline'=>'Independent software. Thoughtfully engineered.','location'=>'United Kingdom'] as $key=>$value) { - SiteSetting::firstOrCreate(['key'=>$key], ['value'=>$value]); + foreach (['site_name' => 'ABSDEV', 'email' => 'hello@absdev.net', 'footer_tagline' => 'Independent software. Thoughtfully engineered.', 'location' => 'United Kingdom'] as $key => $value) { + SiteSetting::firstOrCreate(['key' => $key], ['value' => $value]); } } } diff --git a/routes/web.php b/routes/web.php index ca40b4d..dde8bcd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,4 +1,5 @@ SiteSection::where('is_visible',true)->orderBy('sort_order')->get()->keyBy('key'), - 'settings'=>SiteSetting::pluck('value','key'), + 'sections' => SiteSection::where('is_visible', true)->orderBy('sort_order')->get()->keyBy('key'), + 'settings' => SiteSetting::pluck('value', 'key'), ]); })->name('home'); // Dedicated public service, expertise and process pages. @@ -27,13 +28,13 @@ foreach (['services', 'expertise', 'approach'] as $slug) { })->name($slug); } Route::middleware('guest')->group(function () { - Route::get('/admin/login',[LoginController::class,'show'])->name('login'); - Route::post('/admin/login',[LoginController::class,'login'])->middleware('throttle:5,1')->name('login.submit'); + Route::get('/admin/login', [LoginController::class, 'show'])->name('login'); + Route::post('/admin/login', [LoginController::class, 'login'])->middleware('throttle:5,1')->name('login.submit'); }); -Route::post('/admin/logout',[LoginController::class,'logout'])->middleware('auth')->name('logout'); -Route::prefix('admin')->name('admin.')->middleware(['auth',EnsureAdmin::class])->group(function () { - Route::get('/',Dashboard::class)->name('dashboard'); - Route::get('/sections',Sections::class)->name('sections'); - Route::get('/enquiries',Enquiries::class)->name('enquiries'); - Route::get('/settings',Settings::class)->name('settings'); +Route::post('/admin/logout', [LoginController::class, 'logout'])->middleware('auth')->name('logout'); +Route::prefix('admin')->name('admin.')->middleware(['auth', EnsureAdmin::class])->group(function () { + Route::get('/', Dashboard::class)->name('dashboard'); + Route::get('/sections', Sections::class)->name('sections'); + Route::get('/enquiries', Enquiries::class)->name('enquiries'); + Route::get('/settings', Settings::class)->name('settings'); }); diff --git a/tests/Feature/AbsdevBrandAndHomeTest.php b/tests/Feature/AbsdevBrandAndHomeTest.php index 4057658..c7c0099 100644 --- a/tests/Feature/AbsdevBrandAndHomeTest.php +++ b/tests/Feature/AbsdevBrandAndHomeTest.php @@ -1,19 +1,31 @@ get('/')->assertOk()->assertSee('Ideas')->assertSee('Technology with a human touch.'); } - public function test_homepage_links_to_the_new_pages_and_favicon(): void { + + public function test_homepage_links_to_the_new_pages_and_favicon(): void + { $this->get('/')->assertOk()->assertSee('/favicon.svg')->assertSee('href="'.route('services').'"', false) ->assertSee('href="'.route('expertise').'"', false)->assertSee('href="'.route('approach').'"', false); } - public function test_hidden_cms_section_stays_hidden(): void { - $this->seed(\Database\Seeders\SiteContentSeeder::class); - \App\Models\SiteSection::where('key','hero')->update(['is_visible'=>false]); - $this->get('/')->assertOk()->assertDontSee('Ideasseed(SiteContentSeeder::class); + SiteSection::where('key', 'hero')->update(['is_visible' => false]); + $this->get('/')->assertOk()->assertDontSee('Ideasseed(SiteContentSeeder::class); $this->get('/')->assertOk()->assertSee('Digital experiences built to move your business forward.'); - SiteSection::where('key','hero')->update(['is_visible'=>false]); + SiteSection::where('key', 'hero')->update(['is_visible' => false]); $this->get('/')->assertOk()->assertDontSee('Digital experiences built to move your business forward.'); } - public function test_contact_form_validates_and_saves_enquiry(): void { - Livewire::test(ContactForm::class)->set('name','Test Client')->set('email','client@example.com') - ->set('message','Please build a Laravel website for my business.')->call('submit')->assertHasNoErrors(); - $this->assertDatabaseHas('contact_enquiries',['email'=>'client@example.com','is_read'=>false]); + + public function test_contact_form_validates_and_saves_enquiry(): void + { + Livewire::test(ContactForm::class)->set('name', 'Test Client')->set('email', 'client@example.com') + ->set('message', 'Please build a Laravel website for my business.')->call('submit')->assertHasNoErrors(); + $this->assertDatabaseHas('contact_enquiries', ['email' => 'client@example.com', 'is_read' => false]); } - public function test_guests_cannot_open_admin_dashboard(): void { $this->get('/admin')->assertRedirect(route('login')); } - public function test_non_admin_cannot_access_admin_pages(): void { + + public function test_guests_cannot_open_admin_dashboard(): void + { + $this->get('/admin')->assertRedirect(route('login')); + } + + public function test_non_admin_cannot_access_admin_pages(): void + { $this->actingAs(User::factory()->create())->get('/admin')->assertForbidden(); } - public function test_admin_can_edit_site_content(): void { - $admin=User::factory()->create(['is_admin'=>true]); $this->actingAs($admin); - Livewire::test(Sections::class)->set('key','hero')->set('title','A better digital future') - ->set('body','Custom messaging')->set('is_visible',true)->call('save')->assertHasNoErrors(); - $this->assertDatabaseHas('site_sections',['key'=>'hero','title'=>'A better digital future']); + + public function test_admin_can_edit_site_content(): void + { + $admin = User::factory()->create(['is_admin' => true]); + $this->actingAs($admin); + Livewire::test(Sections::class)->set('key', 'hero')->set('title', 'A better digital future') + ->set('body', 'Custom messaging')->set('is_visible', true)->call('save')->assertHasNoErrors(); + $this->assertDatabaseHas('site_sections', ['key' => 'hero', 'title' => 'A better digital future']); } - public function test_dedicated_public_pages_render_with_navigation_and_content(): void { + + public function test_dedicated_public_pages_render_with_navigation_and_content(): void + { foreach (['services' => 'Digital services', 'expertise' => 'Deep engineering', 'approach' => 'A clear process'] as $url => $heading) { $this->get('/'.$url)->assertOk()->assertSee($heading)->assertSee('Capability with purpose'); } } - public function test_homepage_navigation_links_to_dedicated_pages(): void { + + public function test_homepage_navigation_links_to_dedicated_pages(): void + { $this->seed(SiteContentSeeder::class); $this->get('/')->assertOk()->assertSee('href="'.route('services').'"', false) ->assertSee('href="'.route('expertise').'"', false) ->assertSee('href="'.route('approach').'"', false); } - public function test_honeypot_rejects_spam(): void { - Livewire::test(ContactForm::class)->set('name','Spam')->set('email','spam@example.com') - ->set('message','Spam message example')->set('website','spambot')->call('submit')->assertHasErrors(['website']); - $this->assertSame(0,ContactEnquiry::count()); + + public function test_honeypot_rejects_spam(): void + { + Livewire::test(ContactForm::class)->set('name', 'Spam')->set('email', 'spam@example.com') + ->set('message', 'Spam message example')->set('website', 'spambot')->call('submit')->assertHasErrors(['website']); + $this->assertSame(0, ContactEnquiry::count()); } }