Good call asking first. There are four problems, roughly in order of how bad they are.
SQL injection.$email goes straight into the SQL. An email of ' OR '1'='1 logs in as the first user in the table. Use bindings: DB::select('... WHERE email = ?', [$email]), or better, Eloquent.
MD5 is not password hashing. It is fast by design, so leaked hashes can be cracked by the billion per second. Use Hash::make() to store and Hash::check() to verify. They use bcrypt or argon2 with a salt and a cost factor.
== on hashes. Loose comparison treats two strings that look like numbers in scientific notation, such as "0e1234...", as equal. Some MD5 hashes start that way, so a few different passwords can match each other. Hash::check uses a proper constant-time comparison.
[0] on no result. An unknown email gives an empty array, then a warning, then an error when you read ->password on null.
For the migration itself: you cannot convert existing MD5 hashes into bcrypt, because you do not have the passwords. The usual route is to check the old MD5 once on each user's next login and, if it matches, immediately store Hash::make($password) and clear the old value. After a few months, force a reset for whoever never logged in.