I've assigned Laravel Query Builder to a variable. It changes when being used
问题 it's a WHY-question, not How-to one:) I have assigned a Query Bulder to a variable $query: $query = table::where(['id'=>1, 'this_version'=> 1]); $versions['slug1'] = $query->select('tourist_id', 'tourist_version')->get()->toArray(); print_r($versions); outputs array with 2(!) sub-arrays: Array ( [slug1] => Array ( [0] => Array ( [tourist_id] => 1 [tourist_version] => 1 ) [1] => Array ( [tourist_id] => 2 [tourist_version] => 1 ) ) ) But if I add another line using $query between my $query