andersao/l5-repository

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

Open

#377 geöffnet am 11. Apr. 2017

Auf GitHub ansehen
 (11 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)PHP (868 Forks)batch import
help wanted

Repository-Metriken

Stars
 (4.119 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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(),
      

Contributor Guide