on-internet
← Community

Laravel Eloquent query - Could not convert to int

Stack Overflow ·

I am trying to make build a query on Eloquent using pluck, but for some reason, the return message given to me is: Object of class Illuminate\Support\Collection could not be converted to int (View: /Applications/MAMP/htdocs/Housing_around/resources/views/admin/tasks/create.blade.php) Can someone give me a clue on what is happening? controller method: $house = House::findOrFail(Auth::user()->house->id); $obj = Model::pluck('name', 'id')->all(); $categories = Category::pluck('name', 'id')->all(); $users = User::where('house_id', $house)->pluck('name', 'id'); My view seems to be normal: <div clas

Comments

Sign in or sign up to comment and upvote.

No comments yet.