Create plugin/module without table
Created 4 months ago by iprosoft

Hi, after creating module and stream there are created migrations and after install tables in db. Is there any tutorial of directions how to create plugin without db table ? I wan't to create log reader in admin panel so I don't need table.

ryanthompson  —  4 months ago Best Answer

Sounds like you still want your table builders but not the streams behind them. This can certainly be done and we have a good example of it here: https://github.com/anomalylabs/addons-module/tree/2.2/src/Addon/Table

This particular builder uses a lot of handlers as you can see but check this out for loading entries: https://github.com/anomalylabs/addons-module/blob/2.2/src/Addon/Table/Entries/DownloadedEntries.php

Lastly this particular builder uses views to configure the table so check out this file for how that works: https://github.com/anomalylabs/addons-module/blob/2.2/src/Addon/Table/AddonTableViews.php

edster  —  4 months ago

Just don't make a stream or migrations, you do it the same way, just don't have any migrations to create any tables you don't need.

iprosoft  —  4 months ago

Ok, so in controller I return Table Builder render() , but how attach my data to table builder so it will be used as data from mysql. I mean some magic no hard code.

ryanthompson  —  4 months ago Best Answer

Sounds like you still want your table builders but not the streams behind them. This can certainly be done and we have a good example of it here: https://github.com/anomalylabs/addons-module/tree/2.2/src/Addon/Table

This particular builder uses a lot of handlers as you can see but check this out for loading entries: https://github.com/anomalylabs/addons-module/blob/2.2/src/Addon/Table/Entries/DownloadedEntries.php

Lastly this particular builder uses views to configure the table so check out this file for how that works: https://github.com/anomalylabs/addons-module/blob/2.2/src/Addon/Table/AddonTableViews.php

iprosoft  —  4 months ago

Streams also could be ok, just wanted best solution to generate table in admin panel from my data, not database table data 😄

ryanthompson  —  4 months ago

Yep tables and forms both don't require streams. You can do headless tables/forms and all kinds of cool stuff with very little effort 😄

ryanthompson  —  4 months ago

Don't forget to mark answered if applicable for others.