h"/> h">
Home >Backend Development >PHP Tutorial >orm gets the attribute value in the association table Wang Yin World Programming Language Ranking dos.ormitdos
ORM - Relational Object Model
The Eloquent ORM in laravel is used to interact with data tables. Each database table will interact with a corresponding "model". If you want to know more, please check the official documentation or Baidu. The code to obtain the attribute value in the association table is as follows:
/** * [getContactAttribute 获取卖家联系人] */ public function getContactAttribute() { return $this->hasOne('App\Http\Models\Supplier', 'SupplierId', 'SupplierId')->first()->contact; }
The above introduces ORM to obtain attribute values in the association table, including ORM content. I hope it will be helpful to friends who are interested in PHP tutorials.