I am trying make custom authentication in a Laravel 7 application. Referring to official documentation I should add a public function authenticate() in LoginController, so I tried it:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class LoginController extends Controller
{
/**
* Handle an authentication attempt.
*
* @param \Illuminate\Http\Request $request
*
* @return Response
*/
public function authenticate(Request $request)
{
eval(\Psy\sh()); //console debug line
$credentials = $request->only('email', 'password');
if (Auth::attempt($credentials)) {
// Authentication passed...
return redirect()->intended('dashboard');
}
}
}
But it seems the function is not running on login. I tested by adding debug line eval(\Psy\sh());, but it just not running.
Any idea how to make the function run?