This content may be out-of-date

This book was written circa 2022, when Joomla 4 was still a new thing. It has not been updated for Joomla 5 and beyond, and it's no longer being worked on. You can usually find more up-to-date information in the official Joomla! Manual.

Models

You do not need to have API-specific Models in your component. If you do not provide a Model, the API application will use the Administrator models instead. This is usually what you want to do. There are very few cases where the API application needs a different model to both the Administrator and the Site model.

If you do need to create Models, follow the same conventions as you'd do for Models in the Administrator part of your application. The only difference is that the namespace prefix uses Api instead of Administrator.