This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello everybody, I'm trying OctoberCMS and I pretty much like it. Yesterday I installed the JWT plugin and managed to login on my website from an android app I created purposely.
Now I'd like to create some new models and expose such data to the same app, once I've logged in. In order to do so I installed the API generator plugin but it needs a model in order to generate the API.
I tried then to create a new model, following the guide (https://octobercms.com/docs/database/model). I created the table in the DB, the model php file but apparently that's not enough to make the model pop up in the list inside the API generator wizard. Also I'm stuck because of two main issues: 1- I don't know how to create a plugin-unrelated model. I'd like my model to be available to all the users of the website and free from plugin dependencies. How to do so? 2- What's needed in order to create a model? The guide tells about creating the model file but apparently it's not enough to make it availale. Do I need to launch some artisan command?
Thank you for anybody who will provide any hint on this
Last updated
marco.zanetti27330 said: Also I'm stuck because of two main issues: 1- I don't know how to create a plugin-unrelated model. I'd like my model to be available to all the users of the website and free from plugin dependencies. How to do so? 2- What's needed in order to create a model? The guide tells about creating the model file but apparently it's not enough to make it availale. Do I need to launch some artisan command?
- creating plugin to register models systemwide is mandatory, but the process is easy with the Builder plugin: https://octobercms.com/plugin/rainlab-builder Be sure to watch the accompanying video tutorial.
- if by "create a model" you refer to write new data to database, it depends on where you want to do it - backend (logged-in as CMS admin, still doable with controllers generated from Builder plugin), or frontend/API (probably by writing some code that hooks API generator methods)
1-2 of 2