andersao / andersao/l5-repository

"Serialization of 'Illuminate\Http\UploadedFile' is not allowed"

未关闭
#377 11 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
help wanted
主要语言
PHP
星标
4.2k
派生
880
PR 合并指标
30 天内没有已合并 PR

描述

I Need help to solve this error

Exception
Serialization of 'Illuminate\Http\UploadedFile' is not allowed

vendor\prettus\l5-repository\src\Prettus\Repository\Traits\CacheableRepository.php

* Serialize single criterion with customized serialization of Closures.
*
* @param \Prettus\Repository\Contracts\CriteriaInterface $criterion
* @return \Prettus\Repository\Contracts\CriteriaInterface|array
*
* @throws \Exception
*/
protected function serializeCriterion($criterion)
{
try {
serialize($criterion);

return $criterion;
} catch (Exception $e) {
// We want to take care of the closure serialization errors,
// other than that we will simply re-throw the exception.
if ($e->getMessage() !== "Serialization of 'Closure' is not allowed") {
throw $e;
}

$r = new ReflectionObject($criterion);

return [
'hash' => md5((string) $r),
'properties' => $r->getProperties(),

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。