2017-05-05 5 views
0

aktualisieren Laravel 5.3 von 5.2 und nachdem ich unten Störung erhalte click hereAnruf auf eine Elementfunktion alle() auf Array Nach Update von Laravel 5,2-5,3

FatalErrorException in Builder.php Linie 638: Call to a member Funktion all() auf Array

Ich habe Laravel Shift-Tool zum Upgrade Framework und nach erfolgreichen Composer-Update, ich bin mit diesem Problem konfrontiert.

-Code

public function index() 
{ 
    $static_block_array = []; 
    $static_block  = StaticBlock::whereIn('identifier', [ 
     'DESKTOP_STORE_FRONT_ROW_1_BLOCK', 
     'DESKTOP_STORE_FRONT_ROW_2_BLOCK', 
     'DESKTOP_BOTTOM_BLOCK','SOCIAL_MEDIA_ICON_BLOCK','TOP_ROW_HOMEPAGE_BLOCK']) 
     ->remember(cacheTimeOut(CATALOG_CACHE_TIMEOUT)) 
     ->with("staticBlockContent") 
     ->cacheTags(TAG_CATALOG) 
     ->whereStatus(1) 
     ->get(); 

    foreach ($static_block as $value) { 
     $static_block_array[$value->identifier] = isset($value->staticBlockContent[0]) ? $value->staticBlockContent[0]->content : ""; 
    } 

    return View::make('home/index') 
      ->with('desktop_store_front_first_row', array_get($static_block_array, 'DESKTOP_STORE_FRONT_ROW_1_BLOCK', '')) 
      ->with('desktop_store_front_second_row', array_get($static_block_array, 'DESKTOP_STORE_FRONT_ROW_2_BLOCK', '')) 
      ->with('desktop_top_row_content', array_get($static_block_array, 'TOP_ROW_HOMEPAGE_BLOCK', '')) 
      ->with('desktop_bottom_block', array_get($static_block_array, 'DESKTOP_BOTTOM_BLOCK', '')); 
} 
+0

Kannst du die anstößigen Snippets posten? –

+0

@BagusTesa hinzugefügt bitte überprüfen Sie jetzt –

+0

@BagusTesa der Fehler, ich bekomme es Fehler auf Anbieter Verzeichnis, Vendor/Laravel/Framework/src/Illuminate/Datenbank/Eloquent/Builder.php Linie 638: –

Antwort

0

Ausgabe ist nun behoben. haben wir eine benutzerdefinierte Logik zum Zwischenspeichern von Abfrage in Remember-Methode erstellt, die wir ein einfaches Array zurückgeben, aber nach der Konvertierung in ein Sammlungsobjekt Problem gelöst ist.

return collect($cache->remember($key, $minutes, $callback)); 
Verwandte Themen