I have a one to many relationship between Device and Command models (each Device has many commands). Now I want to update a c
Device
Command
commands
You could try the update method on the \Illuminate\Database\Eloquent\Builder object:
update
\Illuminate\Database\Eloquent\Builder
$queryBuilder = $device->commands()->whereStatus("pending"); $queryBuilder->update(array("status" => "sent"));