Closed MannikJ closed 4 years ago
@Nyratas Is there any progress on solving the issue?
Hi @MannikJ,
I'm quite busy these days and hope to have a few hours for the open issues next week. In the meantime, if this issue needs to be solved quickly for your projects, feel free to suggest a PR :)
@Nyratas Any Help ?
Is there any progress on solving the issue guys?
This seems to be connected to this.
I added
public static $model = '';
either in PageResource and OptionResource and everything started to work.
@pietrolerro Same here. Or just adding it it StaticResource
@pietrolerro @Riggs1992 How am I supposed to add that line? By editing StaticResource
file in vendor
folder?
@4unkur look at the PR I mentioned. We'd wait for the package owner to fix/merge that. Meanwhile, yes, I did edit the files in vendor directory.
@pietrolerro Thank you for the clarification, but that PR is already closed.
@pietrolerro can you try the change suggested in this comment please? https://github.com/whitecube/nova-page/pull/18#issuecomment-466017060
@voidgraphics for me just adding public static $model;
in StaticResource
fixed the issue.
@Nyratas from my understanding we weren't very keen on this approach since it's a bit of a hack. Our Page resources have nothing to do with models. But to allow compatibility with a lot of other packages, and fix various bugs such as this one, it would actually be beneficial, even if it's a temporary solution until we can find a better way to handle it. What do you think?
@voidgraphics I'm sorry 🙏, I can't try😣
Thank you! I ended up overriding the config with my own PageResource.
<?php
namespace App\Nova\NovaPage;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Panel;
/**
* https://github.com/whitecube/nova-page/pull/61
* https://github.com/whitecube/nova-page/issues/33
*
* Class PageResource
* @package App\Nova\NovaPage
*/
class PageResource extends \Whitecube\NovaPage\Pages\PageResource
{
/**
* The model the resource corresponds to.
*
* @var string
*/
public static $model;
}
Then in config/novapage.php
change this line with your own PageResource:
'default_page_resource' => \App\Nova\NovaPage\PageResource::class,
Hope that helps someone else in the meantime that it gets merged.
Hi,
We are not able to create instances of any resource through Nova that has a
MorphTo
field on it, as long as theWhitecube\NovaPage\NovaPageTool
is registered in the NovaServiceProvider. The create form is not even loaded. When we deactivate the tool, everything works fine.The following exception is thrown: