Fix the forgetMiddleware call (to not use get_class)

Undo the changes from #5473, with unit tests to justify why.

I'll just repeat my comment from that commit since it describes the problem:


Just tried upgrading from 4.2.8 to 4.2.9 and had a App::forgetMiddleware('Illuminate\Http\FrameGuard'); call (leftover from 4.1).

This causes an error though, as $m['class'] appears to be a string. According to the middleware function as well, the $class parameter is meant to be a string.

Will try and set up a liferaft or PR with unit test for this, but just wanted to raise it for now before I forget!

Error that gets raised: get_class() expects parameter 1 to be object, string given. The error on the line return get_class($m['class']) != $class;