Models
Explore how AdonisJs models serve as active records representing database tables. Learn to create models, manage timestamps, and fetch data efficiently. This lesson helps you understand wrapping queries and relationships within models for effective database interaction.
We'll cover the following...
We'll cover the following...
A model in AdonisJs is similar to the eloquent of Laravel. It uses the same pattern of active record, which is an approach to access the database. We can wrap database queries and relationships inside models. Every model represents a database table.
Creating a model
Models are created in the app/Models folder. Let’s create a ...