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

  1. create class extends illuminate\auth\passwords\databasetokenrepository
  2. overwrite getpayload() method there
  3. create class extends illuminate\auth\passwords\passwordbrokermanager
  4. overwrite resolve() method return new passwordbroker token repository step 1
  5. open config/app.php , comment out passwordresetserviceprovider providers array
  6. 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

  1. create class extends illuminate\auth\passwords\databasetokenrepository
  2. overwrite getpayload() method there
  3. create class extends illuminate\auth\passwords\passwordresetserviceprovider
  4. overwrite registertokenrepository() return repository step 1
  5. open config/app.php , comment out passwordresetserviceprovider providers array
  6. add provider step 3 providers array

please note haven't tested this, should work on theory.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -