controller global variable in laravel code example Example: global variable in laravel controller private $variable;