Issue using repository methods??? Twill 3
Can someone please provide any support for the following error:
Declaration of App\Repositories\PostRepository::afterSave($object, $fields) must be compatible with A17\Twill\Repositories\ModuleRepository::afterSave(A17\Twill\Models\Contracts\TwillModelContract $model, array $fields): void
I have been looking to set up a repeater as per the twill guidance docs with the following in my PostRepository (however I'm running into some errors):
public function afterSave($object, $fields)
{
$this->updateRepeater($object, $fields, 'credit', 'Credit');
parent::afterSave($object, $fields);
}
public function getFormFields($object)
{
$fields = parent::getFormFields($object);
$fields = $this->getFormFieldsForRepeater($object, $fields, 'credit', 'Credit');
return $fields;
}
Within my twill.config I have set up the repeater:
'repeaters' => [
'credit' => [
'title' => 'Credit',
'trigger' => 'Add credit',
'component' => 'a17-block-credit'
]
],
So am unsure where this error is coming from, any direction would by greatly appreciated.
Best,
Dan
kallefrombosnia•119d ago
When overloading methods from parent, make sure that they are indentical in types too.
ifox•114d ago
@Dan make sure to read the error message, it is pretty clear and something you'll see quite often nowadays as php libraries introduce more strict typing.
1.4KMembers
View on DiscordWant results from more Discord servers?
More PostsHow can I make sure my assets are loaded correctly on a subdomain?I have a site for example website.nl and a twill installation on website.nl/subsite
Now when I go tI can't see any images in twill media library.Hello, everyone!
I have installed twill and tried to upload a image to media library.
However, I amDatePicker ExceptionI'm getting an unexpected error while using a pretty simple DatePicker in my sidebar form.
`UndefinSome fresh vibes would be nice :))Would love to hear some global announcement about twill cms this year and where it's heading @ifox .Edit defaultOrders in controllerWhat would be the most correct way to edit?
$this->defaultOrders of ModuleController in my controlleVue2 EOL Plans?We're upgrading our application and generally upgrading our setup in preparation for the Vue2 EOL at