What frontend starter kit is this?
Sep 16, 2022
8
Level 1
Illuminate\Auth\SessionGuard::login(): Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Authenticatable, null given,
I have a mobile form
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="row mb-3">
<label for="mobile" class="col-md-4 col-form-label text-md-end">{{ __('mobile') }}</label>
<div class="col-md-6">
<input id="mobile" type="text" class="form-control @error('mobile') is-invalid @enderror" name="mobile" value="{{ old('mobile') }}" autocomplete="mobile">
@error('mobile')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('register') }}
</button>
</div>
</div>
</form>
RegisterController
protected function validator(array $data)
{
return Validator::make($data, [
'mobile' => ['required', 'numeric', 'digits:11'],
]);
}
protected function create(array $data)
{
session()->remove('mobile');
$code = rand(1000,9999);
session()->put('mobile',$data['mobile']);
User::query()->create([
'mobile' => $data['mobile'],
'code' => $code,
]);
}
I get this error
Illuminate\Auth\SessionGuard::login(): Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Authenticatable, null given,
Please or to participate in this conversation.