php - how can I get email and password at the same time methop post laravel 5.2 -


i email , password when call authcontroller@login method there isn't in controller.

my proyect : want save activity login , bad passwords , bad email , how many time user tried enter system , corrects logins of course .

my model useractivity have attributes: email,password,datetime . create new variable , save useractivity->save(); when call post method login.

i use

php artisan make:auth 

but in authcontroller.php found functions.

function __construct function validator function create 

but got route php artisan route:list command

post | login | | app\http\controllers\auth\authcontroller@login | web,guest | 

namespace app\http\controllers\auth;  use app\user; use validator; use app\http\controllers\controller; use illuminate\foundation\auth\throttleslogins; use illuminate\foundation\auth\authenticatesandregistersusers;  class authcontroller extends controller {     /*     |--------------------------------------------------------------------------     | registration & login controller     |--------------------------------------------------------------------------     |     | controller handles registration of new users,     | authentication of existing users. default, controller uses     | simple trait add these behaviors. why don't explore it?     |     */      use authenticatesandregistersusers, throttleslogins;      /**      * redirect users after login / registration.      *      * @var string      */     protected $redirectto = '/';      /**      * create new authentication controller instance.      *      * @return void      */     public function __construct()     {         $this->middleware($this->guestmiddleware(), ['except' => 'logout']);     }      /**      * validator incoming registration request.      *      * @param  array  $data      * @return \illuminate\contracts\validation\validator      */     protected function validator(array $data)     {         return validator::make($data, [             'name' => 'required|max:255',             'email' => 'required|email|max:255|unique:users',             'password' => 'required|min:6|confirmed',         ]);     }      /**      * create new user instance after valid registration.      *      * @param  array  $data      * @return user      */     protected function create(array $data)     {         return user::create([             'name' => $data['name'],             'email' => $data['email'],             'password' => bcrypt($data['password']),         ]);     } } 

(i created laravel login way because easier, want diferent. sorry english bad) .

there method postlogin in illuminate/foundation/auth/authenticatesusers.php can overwritten.

eg in authcontroller add:

/**  * handle login request application.  *  * @param  \illuminate\http\request  $request  * @return \illuminate\http\response  */ public function postlogin(request $request) {     dd($request->all());     return parent::postlogin($request); } 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo