mardi 3 janvier 2017

Using custom functions on all pages in Laravel 5

I have a function

public function add($value1,$value2){

$a = $value1;
$b = $value2;
$c = $a + $b;

return $c;

}

To call this function i would use add(1,2)

The problem is : if i want to be able to use this function on any view page in laravel, where do i place it and how do i call it ?

I have tried using it on page and it works fine, i just need a global solution.

public function add($value1,$value2){

    $a = $value1;
    $b = $value2;
    $c = $a + $b;

    return $c;

    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire