In login form i used livewire and when i out focus of phone field my webpage its been white
please help me thanks <3
view code:
<form wire:submit.prevent="login">
<fieldset class="form-label-group form-group position-relative has-icon-left">
<input wire:model.debounce.500ms="phone" type="text" class="form-control" id="phone" placeholder="????? ????">
<div class="form-control-position">
<i class="feather icon-phone"></i>
</div>
<label for="phone">????? ????</label>
</fieldset>
@error('phone') <span class="text-danger">{{ $message }}</span> @enderror
<button type="submit" class="btn btn-primary float-left btn-inline" wire:click.prevent="login">????</button>
</form>
controller code:
class Login extends Component
{
public $phone;
protected $rules = [
'phone' => ['required', 'regex:/^09(1[0-9]|3[1-9]|2[1-9])-?[0-9]{3}-?[0-9]{4}$/', 'exists:users,phone']
];
public function updatedPhone($name)
{
$this->validate($name);
}
public function login(Request $request)
{
$validData = $this->validate();
$user = User::wherePhone($validData['phone'])->first();
dd($user);
$request->session()->flash('auth', [
'user_id' => $user->id,
'remember' => $request->has('remember'),
]);
$code = ActiveCode::generateCode($user);
$user->notify(new ActiveCodeNotification($code, $user->phone));
dd('done');
}
public function render()
{
return view('livewire.auth.login')
->layout('livewire.auth.layouts.layouts');
}
}
question from:
https://stackoverflow.com/questions/66062222/bleaching-the-page-when-submitting-the-form-with-livewire 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…