注销后,Laravel Auth非对象。 中间件运行顺序错误?

Laravel 5.6, I have a middleware that generates my user menus. Within this middleware I have a route which goes to the account edit page;

action("CompanyController@edit", ['company' => Auth::user()->company->id])

If the user logs out the following error is thrown on logout:

ErrorException (E_NOTICE)
Trying to get property 'company' of non-object

I can get around this by changing the route to:

action("CompanyController@edit", ['company' => Auth::check() ? Auth::user()->company->id : ''])

Now an unauthenticated user results in a re-direct to the login page and no errors thrown - as expected.

However this does not feel right. Should the auth middleware not catch this before anything else is executed? Is there any way to get around having to complete the auth check before trying to get user details back?