This isn't a bug, but something minor that I believe could be improved. Generally my use of the autoloader in Tinker is to perform database queries, as it saves you prefixing each model with App\. However, if you're also using Nova in your app all those classes will take precedence because of the order they are loaded.
>>> User::first()
[!] Aliasing 'User' to 'App\Nova\User' for this Tinker session.
PHP Fatal error: Call to undefined method User::first() in Psy Shell code on line 1
>>> App\User::first()
The easiest fix here would be not to alias Nova classes - and I wonder if this might be considered for the default config rather than something you'd have to add yourself.
'dont_alias' => [
'App\Nova'
],
Obviously it assumes your main namespace will be App for this to work, and it won't negatively affect anyone who isn't using Nova. However, it might be a nice improvement to the experience.
This isn't a bug, but something minor that I believe could be improved. Generally my use of the autoloader in Tinker is to perform database queries, as it saves you prefixing each model with
App\
. However, if you're also using Nova in your app all those classes will take precedence because of the order they are loaded.The easiest fix here would be not to alias Nova classes - and I wonder if this might be considered for the default config rather than something you'd have to add yourself.
Obviously it assumes your main namespace will be
App
for this to work, and it won't negatively affect anyone who isn't using Nova. However, it might be a nice improvement to the experience.