drvntaomy06331839 2017-07-27 05:02
浏览 54
已采纳

laravel Auth session expire对数据库执行一些操作

I want to make changes (like change user status to logout) in to database when Auth session expires due to inactivity for some time.

  • 写回答

1条回答 默认 最新

  • doubei5114 2017-07-27 06:35
    关注

    If you don't want control it after a request (which can be done with middlewares) you should use the Database Session Driver. Change it in config/session to 'driver' => 'database'. Then create the session table with artisan:

    php artisan session:table
    
    composer dump-autoload
    
    php artisan migrate
    

    Now you are able to check for users status on sessions table.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?