It is known that the model in tp5 can automatically associate a data table, provided that the database where the table is located has been connected. Please tell me, in addition to configuring the database information in database.php, can I connect to the database in the model file? Yes. What if you define the link function in the class and then call the function in other files?
Look at the manual, this one has an introduction