php - password reset table column name override laravel 5 -
hello friends have modified password reset table column name 'created_at' instead of 'created'. if changing column name 'created' on migration, getting error column not found 'created_at'.
\vendor\laravel\framework\src\illuminate\auth\passwords\databasetokenrepository.php protected function getpayload($email, $token) { return ['email' => $email, 'token' => $token, 'created_at' => new carbon]; }
this file coming column name 'created_at' can override function please suggest me..
i think i've found way without touching vendor directory.
for laravel 5.2
- create class extends
illuminate\auth\passwords\databasetokenrepository
- overwrite getpayload() method there
- create class extends
illuminate\auth\passwords\passwordbrokermanager
- overwrite resolve() method return new passwordbroker token repository step 1
- open
config/app.php
, comment out passwordresetserviceprovider providers array in app service provider register instance of password broker manager step 3
$this->app->singleton('auth.password', function ($app) { return new yourpasswordbrokermanager($app); });
$this->app->bind('auth.password.broker', function ($app) { return $app->make('auth.password')->broker(); });
for lravel 5
- create class extends
illuminate\auth\passwords\databasetokenrepository
- overwrite getpayload() method there
- create class extends
illuminate\auth\passwords\passwordresetserviceprovider
- overwrite registertokenrepository() return repository step 1
- open
config/app.php
, comment out passwordresetserviceprovider providers array - add provider step 3 providers array
please note haven't tested this, should work on theory.
Comments
Post a Comment