As far as I'm aware find only returns one database row. What happens if you don't use pluck, what do you get? How do you know you are getting all registered names and ids? are you dd
ing the result?
use where() instead of find()
$department = Department::where('id',$office->department_id)->pluck('name', 'id');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community