whitecube / nova-page

Static pages content management for Laravel Nova
https://whitecube.github.io/nova-page
MIT License
238 stars 41 forks source link

Fix error when searching #11

Closed einardivision closed 5 years ago

einardivision commented 5 years ago

I was getting an error when trying to search in the control panel, nova wanted to call undefined static property model, so by defining this value here you nullify and error and everything works.

toonvandenbos commented 5 years ago

Hi @einardivision,

Thanks for your pull-request!

I think the NovaPage Resource is potentially as important in the global search as other "model" Resources. Therefore, maybe we should make it available for search instead of disabling it.

Honestly, I didn't try to make it work with the global search yet and that's why you're facing this issue. We should take a deeper look into it as soon as possible.

einardivision commented 5 years ago

Yeah i just wanted to put it here incase someone else was having troubles :)

toonvandenbos commented 5 years ago

Thanks a lot for that :)

LasseHaslev commented 5 years ago

I agree that the global search is relevant for the page resource as #15. But at this point this package is breaking the global search for every other nova resource.

Until the global search works with Page resources I suggest we disable it entierly.

/**
 * Indicates if the resoruce should be globally searchable.
 *
 * @var bool
 */
public static $globallySearchable = false;
voidgraphics commented 5 years ago

@LasseHaslev I agree, and I just pushed a new release (v0.2.1) that does exactly what you suggested. Hopefully we can find some time to fix the search properly soon.

LasseHaslev commented 5 years ago

@voidgraphics it works! Thanks for quick response and great package!