Answer the question
In order to leave comments, you need to log in
How to login via mobile phone?
How to make authorization using a mobile phone do not need SMS?
I want to change authorization from email (since you don't need to enter email when registering) to a mobile phone. google didn't help
much thanks in advance
Answer the question
In order to leave comments, you need to log in
If the phone field is in the useres table and you want to do AUTHENTICATION by phone and password without SMS, then for this you need to add the username() method
in the App\Http\Controllers\Auth\LoginController controller , which should return the name of the column in which the phone is stored
public function username()
{
return 'phone';
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
use AuthenticatesUsers;
protected $redirectTo = '/profile';
public function __construct()
{
$this->middleware('guest')->except('logout');
}
/**
* Тот самый метод
*/
public function username()
{
return 'phone';
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question