dimanche 10 juin 2018

Laravel access data array

I have an array with some data in a controller, something like this..

        $data['countries'] = array(
            ["code" => "fr","title" => "French", "flag" => "https://www.makkumbeach.nl/img/flag_fe.gif"], 
            ["code" => "es","title" => "Spain", "flag" => "https://www.eurojobs.com/templates/Eurojobs/main/images/flags/Spain.gif"]
        );

But the problem is that I need this array inside another controller, is there a simple solution for that? Instead of copying the data twice.

Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire