Joining Model with Table Laravel 5.2
问题 I have created a model in Laravel. class deals extends Model { // protected $table = 'tbl_deal'; } Now I want to use this model to retrieve data in my Controller. However, the data extracted from this model also needs to be constrained by a column in another table. Below is the basic schema tbl_deal deal_id merchant_id deal_text tbl_merchant merchant_id merchant_url_text My current Controller has the following code to extract all deals from deals model. $deals = deals::all(); I want to