refactor(login): menggunakanan trait WithUpdatedData
This commit is contained in:
parent
c2e2b85070
commit
87c9b955c3
@ -3,6 +3,7 @@
|
|||||||
namespace App\Livewire\Auth;
|
namespace App\Livewire\Auth;
|
||||||
|
|
||||||
use App\Enums\UserStatus;
|
use App\Enums\UserStatus;
|
||||||
|
use App\Traits\WithUpdatedData;
|
||||||
use Flux\Flux;
|
use Flux\Flux;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Attributes\Validate;
|
use Livewire\Attributes\Validate;
|
||||||
@ -13,6 +14,8 @@
|
|||||||
])]
|
])]
|
||||||
class Login extends Component
|
class Login extends Component
|
||||||
{
|
{
|
||||||
|
use WithUpdatedData;
|
||||||
|
|
||||||
#[Validate(['required', 'string'], attribute: 'nama pengguna atau alamat surel')]
|
#[Validate(['required', 'string'], attribute: 'nama pengguna atau alamat surel')]
|
||||||
public string $login = '';
|
public string $login = '';
|
||||||
|
|
||||||
@ -58,11 +61,6 @@ public function auth()
|
|||||||
$this->redirectIntended('/studio/dashboard/overview', navigate: true);
|
$this->redirectIntended('/studio/dashboard/overview', navigate: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updated(string $prop, string $value)
|
|
||||||
{
|
|
||||||
$this->validateOnly($prop);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.auth.login');
|
return view('livewire.auth.login');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user