andersao / andersao/l5-repository

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

オープン
#377 コメント 11 件 リアクション 2 件 担当者 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 を短くまとめたダイジェスト。