Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to declare global variable in laravel controller

class TestController extends Controller
{
    private $x;

    public function index()
    {
        $this->x ='22';
    }

    public function send_message()
    {
        echo $this->x;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #declare #global #variable #laravel #controller
ADD COMMENT
Topic
Name
1+5 =