Laravel-5 adding hasRole method to Auth

前端 未结 3 1428
情话喂你
情话喂你 2021-02-06 16:03

I\'m trying to extend the Laravel-5.1 Auth middleware so that I can add my own method to it:

Auth::hasRole()

What do I need to do in or

3条回答
  •  孤独总比滥情好
    2021-02-06 16:22

    There are some good packages to help with this if you don't want to brew your own. I can recommend both: Zizaco Entrust: https://github.com/Zizaco/entrust and Sentinel: https://cartalyst.com/manual/sentinel/2.0

提交回复
热议问题