Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error when changing the $contentColumn property on model #174

Closed
andrewdmaclean opened this issue Oct 27, 2022 · 2 comments
Closed

Comments

@andrewdmaclean
Copy link

Describe the bug
When following the instructions in the README to change the $contentColumn property on model, I am presented with the error:
App\Models\[MyModel] and VanOns\Laraberg\Traits\RendersContent define the same property ($contentColumn) in the composition of App\Models\[MyModel]. However, the definition differs and is considered incompatible. Class was composed.

To Reproduce
Steps to reproduce the behavior:

  1. Select a Model
  2. Add the following to said Model
use VanOns\Laraberg\Traits\RendersContent;

class MyModel extends Model {
  use RendersContent;

  protected $contentColumn = 'my_column';
}
  1. See error

Expected behavior
No error and able to use $model->render() as outlined.

Environment (please complete the following information):

  • Laraberg Version: [e.g. 1.0.0]
  • OS: Windows 10
  • Browser: Firefox
  • Version:106.0.1

Temporary Fix
I have added the following constructor which seems to fix the issue but seems a bit... hacky.

   public function __construct()
     {
          $this->contentColumn = 'my_column';
     }
@github-actions
Copy link

This issue has been automatically marked as stale because it has been open for 60 days with no activity.

@arman-arif
Copy link
Contributor

arman-arif commented Jan 1, 2023

I got the same issue with the $contentColumn property

App\Models\Blog and VanOns\Laraberg\Traits\RendersContent define the same property ($contentColumn) in the composition of App\Models\Blog. However, the definition differs and is considered incompatible. Class was composed

arman-arif added a commit to arman-arif/laraberg that referenced this issue Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants