Laravel does not need to fill out a form to log in?

laravel"s default login process is to log in through the form user entering the account password, and then submit the form to log in.

but I want to access a method in a controller, and then log in to a user (specified by the user in the controller), that is, log in without submitting a form,

is there a way to achieve this?

Mar.10,2021

use a middleware, and then attach the middleware to the desired route.
the mid-price code is basically like this:

  

uses Auth::guard ()-> login ($user, true); is solved;
where $user is the User model, and the Authenticatable class needs to be referenced in the model

Menu