A
A
Archakov Dennis2015-06-10 23:04:52
Laravel
Archakov Dennis, 2015-06-10 23:04:52

How to work with cookies in Laravel?

I execute the following code: The script refuses to work with Cookie, I point out this error:
\Cookie::put('rid', $rid, 60);

Call to undefined method Illuminate\Cookie\CookieJar::put()

I have googled for more than an hour and re-read various posts and solutions, but none help :(
In app.php added:
'Illuminate\Cartalyst\Sentry\SentryServiceProvider',

But writes:
Class 'Illuminate\Cartalyst\Sentry\SentryServiceProvider' not found

Although there is such a PHP file. And the path is exactly right, I copied the folder at the same time to Illuminate .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2015-06-10
@JhaoDa

The \Cookie::put() method does not exist. There are make() and forever() methods, as well as a cookie() helper. If you want to not only create a cookie, but also send it to the client, then you need to attach it to the response:
And at the same time, tell us what is the connection between cookies and Sentry, and what does Cartalyst\Sentry\SentryServiceProvider suddenly do in the Illuminate namespace, and why did you copy some folders somewhere?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question