Laravel private variable shared between two methods in Controller

前端 未结 2 475
一生所求
一生所求 2020-12-16 22:28

How to use private variable in Laravel Controller, and share that variable value between two methods. (Set it in one use it in another).

2条回答
  •  借酒劲吻你
    2020-12-16 23:05

    You can also use Setting approach outlined here

    laravel share variable across all methods in a controller

    and

    Laravel: Passing default variables to view

    and you can download Setting here, https://github.com/Phil-F/Setting

提交回复
热议问题