Whelp, I figured the issue out. I forgot to update the relationships in my models...
D'oh /facepalm
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
For my current project, I have a need to create models and resources under subdirectories.
For example, I have a model under App\App1\Post.php and a Nova resource under App\Nova\App1\Post.php. I have updated namespaces on both the model and resource, as well as any model references. When viewing a resource that does not have any relationships, everything works fine. I can view my resources, create new records, etc. However, when using BelongsTo or any other relationship field, I get an error (via the toast at the bottom of any page) that App\Nova\Post cannot be found. If I update the make method on my BelongsTo field to BelongsTo::make('Post', 'post', 'App\Nova\App1\Post') the error changes to App\Post cannot be found.
Here is the exception text (just the message, I can provide stack trace if needed):
[2020-04-24 18:08:04] local.ERROR: Class 'App\Nova\Post' not found {"userId":1,"exception":"[object] (Error(code: 0): Class 'App\\Nova\\Post' not found at /<path to project>/vendor/laravel/nova/src/Fields/BelongsTo.php:117)
The exception text is pretty much the same once I make the BelongsTo::make() change I mentioned above, the class name just changes to App\Post and App\\Post.
I'm assuming I have some configuration issue(s) somewhere. Please let me know if I need to provide any additional details or code.
Thanks in advance
Whelp, I figured the issue out. I forgot to update the relationships in my models...
D'oh /facepalm
Please or to participate in this conversation.