cyrildewit / eloquent-viewable

Associate views with Eloquent models in Laravel
MIT License
803 stars 104 forks source link

Getting an error: Cannot record a view for a viewable type. #258

Closed chintakdholakia closed 2 years ago

chintakdholakia commented 2 years ago

Description:

Getting this error: CyrildeWit\EloquentViewable\Exceptions\ViewRecordException Cannot record a view for a viewable type.

Steps To Reproduce:

  1. Open the page where the Record tag is stored in the controller.
cyrildewit commented 2 years ago

It means that your model is not saved to the database before you pass it in the views() function. You can't record a view for a viewable type. It must exists first.

Elusoji commented 2 years ago

I am having the same issue but my model is saved to the database

but it's working with Post model not movie model

cyrildewit commented 2 years ago

@Elusoji okey. What am I supposed to do now? When filling in a bug report it's extremely useful to write down a list of steps to reproduce the bug including an expectation and what actual happens description. I would like to help, but I can't if you don't provide sufficient information.

Hopefully you managed to get it working in the meantime. Greetings.