As this is a UPDATE and not a SELECT you should use:
DB::statement(query);
Also @sergiu17 's shared a link to docs with a better alternative:
https://laravel.com/docs/8.x/database#running-an-update-statement
You might have to tweak your query to use bindings instead of inlinig the values in the query, but that will also prevent SQL injection.
DB::update('UPDATE dispatch
SET
deptId = ?,
type= ?,
destination = ?,
purpose = ?,
passengers = ?,
odometer_start = ?,
dateStart = ?,
vehicle_cost_code = ?,
unitId = ?
WHERE
tripTicket = ?', [
$department,
$type,
$dest,
$purpose,
$pass,
$odom_s,
$app_date,
$vcode,
21,
$ticket,
]);
I was not aware of that option, thanks @sergiu17 .