J
J
junart2016-07-08 21:14:45
Laravel
junart, 2016-07-08 21:14:45

Where to store the result in PHP from the response from the server?

In the controller I receive data from a request for an external resource. The response contains an object with a field page.
How and where can I save this result for the entire client session?
So that the next request sends a request with the updated page?
Say, in Objective C, a model with a singleton method is used for this, roughly speaking a static variable available in each application controller throughout the session.
In php (Laravel) - everything seems to be different.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ernest Faizullin, 2016-07-08
@erniesto77

as an option

Cache::set('key');

Cache::put('key', 'value');

$key = Cache::get('key'); // 'value'

// а это на всякий случай
Cache::forget('key');

https://laravel.com/docs/5.2/cache

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question