Sometimes when I'm making a request I have a common piece of data, so I will set it in the BaseController
like so:
$this->data['cities'] = Cities::get();
However the controllers $this
is not available in models or filters. Is it a good idea to create some kind of Data
service for this with a couple methods for set
and `get?
Data::set('cities', Cities::get());
Data::get('cities');
This way I can just access my data from anywhere.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community