laravel-widgetize icon indicating copy to clipboard operation
laravel-widgetize copied to clipboard

Technique of storing widgets configuration per instance?

Open Yahav opened this issue 4 years ago • 2 comments

My objective is to have my users be able to add widgets to their pages. However some widgets may require user provided configuration, for example, a weather widget, the user will be required to input the desired city.. How/where would you store this instance specific information? is that an existing functionality?

Yahav avatar Nov 09 '19 17:11 Yahav

hmmm,... You mean something like October CMS widgets ?

imanghafoori1 avatar Nov 09 '19 17:11 imanghafoori1

I think you should pass your config data as the second argument to the @widget() and the will be passed to the controller of that widget. that's it. in fact you should wrap some code around the current widgets according to your needs.

imanghafoori1 avatar Nov 09 '19 17:11 imanghafoori1