Question: In PHP, I used to define some variables in my `header.php` and use them in all my pages. How can I have something like that in Laravel?

I am not talking about `View::share('xx', 'xx' );`

Assume I want to have a variable which holds a number in it and I need this number inside all my controllers to calculate something.

Answer: 
Set a property on the `BaseController`, which should be located in your `controllers` directory.

Your controllers should extend the `BaseController` class and thus inherit its properties.
You can define them in your `app\Http\Controllers\Controller.php` , for example:

```
<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    public $test = 'something';

    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}

```

Then afterwards in all of your controllers, you can access this property by doing:

`$this->test;`