Laravel - Serialization of 'Closure' is not allowedLaravel: Permission Denied in Blade FileLaravel “Serialization of 'Closure' is not allowed”Laravel 5.2 Login of a userLaravel 5 loading phpBB 3.1Cannot access env variables in LaravelLaravel 5.6 - Using model functions in ModelFactoryGetting old cache view when there is PHP errors in controller - Laravel 5.6Nginx Laravel config returning 403Add Profile Information in MyAccountController [backpack-laravel]Method IlluminateAuthRequestGuard::attempt does not exist. when trying custom authentication via web route
Question about Shemot, locusts
How can I get a refund from a seller who only accepts Zelle?
Navigating a quick return to previous employer
Is there an idiom that means that you are in a very strong negotiation position in a negotiation?
Did significant numbers of Japanese officers escape prosecution during the Tokyo Trials?
Using too much dialogue?
Why is unzipped directory exactly 4.0K (much smaller than zipped file)?
Merge pdfs sequentially
Cisco 3750X Power Cable
Is this homebrew "Cactus Grenade" cantrip balanced?
Status of proof by contradiction and excluded middle throughout the history of mathematics?
Why do the i8080 I/O instructions take a byte-sized operand to determine the port?
Why is std::ssize() introduced in C++20?
Is superuser the same as root?
Why'd a rational buyer offer to buy with no conditions precedent?
Is a world with one country feeding everyone possible?
Was this scene in S8E06 added because of fan reactions to S8E04?
Visual Block Mode edit with sequential number
Who wrote “A writer only begins a book. A reader finishes it.”
These Two Cubes are The Only Ones That Are All Pure Prime..name them
What did Brienne write about Jaime?
To exponential digit growth and beyond!
Why did it take so long for Germany to allow electric scooters / e-rollers on the roads?
Quantum corrections to geometry
Laravel - Serialization of 'Closure' is not allowed
Laravel: Permission Denied in Blade FileLaravel “Serialization of 'Closure' is not allowed”Laravel 5.2 Login of a userLaravel 5 loading phpBB 3.1Cannot access env variables in LaravelLaravel 5.6 - Using model functions in ModelFactoryGetting old cache view when there is PHP errors in controller - Laravel 5.6Nginx Laravel config returning 403Add Profile Information in MyAccountController [backpack-laravel]Method IlluminateAuthRequestGuard::attempt does not exist. when trying custom authentication via web route
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am using Laravel 5.7 and... well, this error is happening because of a library that i am using right now: highideas/laravel-users-online in which this function:
public function setCache($minutes = 5)
return Cache::put($this->getCacheKey(), $this->getCacheContent(), $minutes);
Throws the next error:
Serialization of 'Closure' is not allowed
The two functions that it uses are:
public function getCacheContent()
if (!empty($cache = Cache::get($this->getCacheKey())))
return $cache;
$cachedAt = Carbon::now();
return [
'cachedAt' => $cachedAt,
'user' => $this,
];
And:
public function getCacheKey()
return sprintf('%s-%s', "UserOnline", $this->id);
Is there a way to fix this error?
laravel
|
show 5 more comments
I am using Laravel 5.7 and... well, this error is happening because of a library that i am using right now: highideas/laravel-users-online in which this function:
public function setCache($minutes = 5)
return Cache::put($this->getCacheKey(), $this->getCacheContent(), $minutes);
Throws the next error:
Serialization of 'Closure' is not allowed
The two functions that it uses are:
public function getCacheContent()
if (!empty($cache = Cache::get($this->getCacheKey())))
return $cache;
$cachedAt = Carbon::now();
return [
'cachedAt' => $cachedAt,
'user' => $this,
];
And:
public function getCacheKey()
return sprintf('%s-%s', "UserOnline", $this->id);
Is there a way to fix this error?
laravel
What's in here$this->getCacheContent()
?Cache::put('key', 'value', $min);
requires second parameter to be string
– senty
Mar 23 at 22:09
The code of that function is in my question
– Enrique Bermúdez
Mar 23 at 22:10
TheFileStore.php
file says that the second parameter "value" is a mixed, not a string
– Enrique Bermúdez
Mar 23 at 22:12
Oh sorry, missed that. It's returning an array, however the required parameter should be string. You can tryserialize($this->getCacheContent())
to convert array to string
– senty
Mar 23 at 22:12
1
Cache::put
will already callserialize
internally. I suspect issue is related to theuser
variable, which contains some data which cannot be automatically serialized.
– levi
Mar 23 at 22:50
|
show 5 more comments
I am using Laravel 5.7 and... well, this error is happening because of a library that i am using right now: highideas/laravel-users-online in which this function:
public function setCache($minutes = 5)
return Cache::put($this->getCacheKey(), $this->getCacheContent(), $minutes);
Throws the next error:
Serialization of 'Closure' is not allowed
The two functions that it uses are:
public function getCacheContent()
if (!empty($cache = Cache::get($this->getCacheKey())))
return $cache;
$cachedAt = Carbon::now();
return [
'cachedAt' => $cachedAt,
'user' => $this,
];
And:
public function getCacheKey()
return sprintf('%s-%s', "UserOnline", $this->id);
Is there a way to fix this error?
laravel
I am using Laravel 5.7 and... well, this error is happening because of a library that i am using right now: highideas/laravel-users-online in which this function:
public function setCache($minutes = 5)
return Cache::put($this->getCacheKey(), $this->getCacheContent(), $minutes);
Throws the next error:
Serialization of 'Closure' is not allowed
The two functions that it uses are:
public function getCacheContent()
if (!empty($cache = Cache::get($this->getCacheKey())))
return $cache;
$cachedAt = Carbon::now();
return [
'cachedAt' => $cachedAt,
'user' => $this,
];
And:
public function getCacheKey()
return sprintf('%s-%s', "UserOnline", $this->id);
Is there a way to fix this error?
laravel
laravel
asked Mar 23 at 22:03
Enrique BermúdezEnrique Bermúdez
471320
471320
What's in here$this->getCacheContent()
?Cache::put('key', 'value', $min);
requires second parameter to be string
– senty
Mar 23 at 22:09
The code of that function is in my question
– Enrique Bermúdez
Mar 23 at 22:10
TheFileStore.php
file says that the second parameter "value" is a mixed, not a string
– Enrique Bermúdez
Mar 23 at 22:12
Oh sorry, missed that. It's returning an array, however the required parameter should be string. You can tryserialize($this->getCacheContent())
to convert array to string
– senty
Mar 23 at 22:12
1
Cache::put
will already callserialize
internally. I suspect issue is related to theuser
variable, which contains some data which cannot be automatically serialized.
– levi
Mar 23 at 22:50
|
show 5 more comments
What's in here$this->getCacheContent()
?Cache::put('key', 'value', $min);
requires second parameter to be string
– senty
Mar 23 at 22:09
The code of that function is in my question
– Enrique Bermúdez
Mar 23 at 22:10
TheFileStore.php
file says that the second parameter "value" is a mixed, not a string
– Enrique Bermúdez
Mar 23 at 22:12
Oh sorry, missed that. It's returning an array, however the required parameter should be string. You can tryserialize($this->getCacheContent())
to convert array to string
– senty
Mar 23 at 22:12
1
Cache::put
will already callserialize
internally. I suspect issue is related to theuser
variable, which contains some data which cannot be automatically serialized.
– levi
Mar 23 at 22:50
What's in here
$this->getCacheContent()
? Cache::put('key', 'value', $min);
requires second parameter to be string– senty
Mar 23 at 22:09
What's in here
$this->getCacheContent()
? Cache::put('key', 'value', $min);
requires second parameter to be string– senty
Mar 23 at 22:09
The code of that function is in my question
– Enrique Bermúdez
Mar 23 at 22:10
The code of that function is in my question
– Enrique Bermúdez
Mar 23 at 22:10
The
FileStore.php
file says that the second parameter "value" is a mixed, not a string– Enrique Bermúdez
Mar 23 at 22:12
The
FileStore.php
file says that the second parameter "value" is a mixed, not a string– Enrique Bermúdez
Mar 23 at 22:12
Oh sorry, missed that. It's returning an array, however the required parameter should be string. You can try
serialize($this->getCacheContent())
to convert array to string– senty
Mar 23 at 22:12
Oh sorry, missed that. It's returning an array, however the required parameter should be string. You can try
serialize($this->getCacheContent())
to convert array to string– senty
Mar 23 at 22:12
1
1
Cache::put
will already call serialize
internally. I suspect issue is related to the user
variable, which contains some data which cannot be automatically serialized.– levi
Mar 23 at 22:50
Cache::put
will already call serialize
internally. I suspect issue is related to the user
variable, which contains some data which cannot be automatically serialized.– levi
Mar 23 at 22:50
|
show 5 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318809%2flaravel-serialization-of-closure-is-not-allowed%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318809%2flaravel-serialization-of-closure-is-not-allowed%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What's in here
$this->getCacheContent()
?Cache::put('key', 'value', $min);
requires second parameter to be string– senty
Mar 23 at 22:09
The code of that function is in my question
– Enrique Bermúdez
Mar 23 at 22:10
The
FileStore.php
file says that the second parameter "value" is a mixed, not a string– Enrique Bermúdez
Mar 23 at 22:12
Oh sorry, missed that. It's returning an array, however the required parameter should be string. You can try
serialize($this->getCacheContent())
to convert array to string– senty
Mar 23 at 22:12
1
Cache::put
will already callserialize
internally. I suspect issue is related to theuser
variable, which contains some data which cannot be automatically serialized.– levi
Mar 23 at 22:50