I have this code. Everything works fine - it gets data from DB but i cannot be returned. I'm posting it using jQuery.
Route::post('get/images', function(){
$images = App\Images::where('realisation_id',Request::get('id'));
return $images;
});
And it returns
Object of class Illuminate\Database\Eloquent\Builder could not be converted to string
I'm stupid!
Route::post('get/images', function(){
$images = App\Images::where('realisation_id',Request::get('id'))->get();
return $images->toJson();
});
And everything is cool!