Add local-only test login and Finnish pagination strings

- /dev/login signs in a test user and returns to the requested page.
  It is registered only when APP_ENV=local and is named "login", so the
  auth middleware redirects there. It stands in for the real login,
  which arrives in phase 1.
- Translate the Flux pagination summary and previous/next button labels
  into Finnish, so screen readers do not read English on Finnish pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-22 10:28:58 +02:00
co-authored by Claude Opus 5.5
parent a3fb09bbf6
commit 73d535278d
4 changed files with 50 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"Showing": "Tulokset",
"to": "–",
"of": "/",
"results": "kpl"
}
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
'previous' => 'Edellinen sivu',
'next' => 'Seuraava sivu',
];
+28
View File
@@ -1,5 +1,33 @@
<?php <?php
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
Route::livewire('/', 'pages::home')->name('home'); Route::livewire('/', 'pages::home')->name('home');
/*
|--------------------------------------------------------------------------
| Local test login
|--------------------------------------------------------------------------
|
| Temporary stand-in for the real login, which arrives in phase 1. Exists
| only when APP_ENV=local: it signs in a test user and returns to the page
| that asked for login. Named "login" so the auth middleware redirects here.
| Remove it when the real login page is built.
|
*/
if (app()->environment('local')) {
Route::get('/dev/login', function () {
$user = User::query()->firstOrCreate(
['email' => '[email protected]'],
['name' => 'Testikäyttäjä', 'password' => Str::password()],
);
Auth::login($user);
request()->session()->regenerate();
return redirect()->intended(route('customers.index'));
})->middleware('web')->name('login');
}
+10
View File
@@ -0,0 +1,10 @@
<?php
use Illuminate\Support\Facades\Route;
it('does not offer the local test login outside the local environment', function () {
expect(app()->environment())->not->toBe('local')
->and(Route::has('login'))->toBeFalse();
$this->get('/dev/login')->assertNotFound();
});