Array to string conversion #13
Replies: 14 comments 2 replies
-
Hey @espositodaniele ATM, the package doesn't provide a default config file. You used code snipped from the README example, where we use Also, I'll release a new package version soon, that already contains an easy way to publish default config file. |
Beta Was this translation helpful? Give feedback.
-
Hello! Thanks for responding. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
@espositodaniele I hope I've answered to you question. BTW: I've also updated documentation on README a bit, I hope it will help you. If not - feel free to update it and create a PR when you will find an issue. Good luck with debugging the issue ;) |
Beta Was this translation helpful? Give feedback.
-
hey @espositodaniele Have you solved your issue? |
Beta Was this translation helpful? Give feedback.
-
Helloi @lptn, unfortunately no!
Could you please try to write step by step what this package needs to work?
This is the step I've done.
return [
Text::make('Title'),
Unlayer::make('Design')->config([
'projectId' => config('unlayer.project_id'), //this should be the config that I'm not able to publish
])
->savingCallback(function (NovaRequest $request, $attribute, Campaign $newsletterModel, $htmlFieldName) {
$newsletterModel->html = $request->input($htmlFieldName);
}),
]; Now when I open the create page on nova the unlayer appear but I'm not able to save as for the error above. Thanks again |
Beta Was this translation helpful? Give feedback.
-
you need firstly to update package version to be able to publish a config (config is available from v1.0.3)
You did everything right. But additionally, you can have attribute casting or attribute getters and setters or other Laravel's magic that may cause these issues, without i full exception stracktrace I can't help you, sorry. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
unfortunately, that's not enough: required info hidden under |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Really Thanks for you support. Could be this? |
Beta Was this translation helpful? Give feedback.
-
Hey @espositodaniele I think it's more convenient to use discussion for your issue. Honestly, I'm 80% sure this is not an issue with our package, but for these 20% I'll try to help you and probably can make this package even better. Unfortunately, because of
thanks! |
Beta Was this translation helpful? Give feedback.
-
Hey @lptn , here is the trace:
|
Beta Was this translation helpful? Give feedback.
-
Also if you have any other channel where we can share information to solve this I will be happy to debug with you e maybe we will be in touch more easy. |
Beta Was this translation helpful? Give feedback.
-
I've maybe find the problem: I did a try to insert data in my table what is missing on the save action is a json_encode. This is not working and I got array to string conversion error. $array = ['Daniele' => 'ciao'];
$campain = Campaign::create([
'title' => 'test',
'design' => $array
]); This instead is working: $array = json_encode(['Daniele' => 'ciao']);
$campain = Campaign::create([
'title' => 'test',
'design' => $array
]); Could be this ? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hello,
First of all thanks for this package.
I've correctly installed the package but I had same error on save. Every time I try to save I'm having this error:
I would also ask some more information to get correctly working this field. Here is the code:
config('unlayer.project_id')
where it get the config?What should I do to save correctly the config design ?
I've created a field on my table with json type to save the design as you illustrate on the docs, and also a content field to save html code.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions