<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class PayrollStructureDetail extends Model { public function head(){ return $this->belongsTo('App\Models\PayrollHead','head_id','id')->orderBy('name'); } }