feat: update to Laravel 12 starter kit (#1)

fix: path of ScreenGeneratorCommand
This commit is contained in:
Benjamin Nussbaum 2025-02-25 12:15:35 +01:00 committed by GitHub
parent 199511816e
commit 94f5cabcff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
110 changed files with 3260 additions and 3524 deletions

View file

@ -10,11 +10,13 @@ class Logout
/**
* Log the current user out of the application.
*/
public function __invoke(): void
public function __invoke()
{
Auth::guard('web')->logout();
Session::invalidate();
Session::regenerateToken();
return redirect('/');
}
}

View file

@ -0,0 +1,13 @@
<?php
namespace App\Livewire;
use Livewire\Component;
class DeviceDashboard extends Component
{
public function render()
{
return view('livewire.device-dashboard', ['devices' => auth()->user()->devices()->paginate(10)]);
}
}

View file

@ -49,11 +49,7 @@ class DeviceManager extends Component
])->create();
$this->reset();
\Flux::modal('create-device')->close();
session()->flash('message', 'Device created successfully.');
}
public function toggleDeviceForm()
{
$this->showDeviceForm = ! $this->showDeviceForm;
}
}

View file

@ -1,72 +0,0 @@
<?php
namespace App\Livewire\Forms;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Validate;
use Livewire\Form;
class LoginForm extends Form
{
#[Validate('required|string|email')]
public string $email = '';
#[Validate('required|string')]
public string $password = '';
#[Validate('boolean')]
public bool $remember = false;
/**
* Attempt to authenticate the request's credentials.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function authenticate(): void
{
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only(['email', 'password']), $this->remember)) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'form.email' => trans('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
}
/**
* Ensure the authentication request is not rate limited.
*/
protected function ensureIsNotRateLimited(): void
{
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
return;
}
event(new Lockout(request()));
$seconds = RateLimiter::availableIn($this->throttleKey());
throw ValidationException::withMessages([
'form.email' => trans('auth.throttle', [
'seconds' => $seconds,
'minutes' => ceil($seconds / 60),
]),
]);
}
/**
* Get the authentication rate limiting throttle key.
*/
protected function throttleKey(): string
{
return Str::transliterate(Str::lower($this->email).'|'.request()->ip());
}
}