How to use private variable in Laravel Controller, and share that variable value between two methods. (Set it in one use it in another).
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