Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

xim's avatar
class EmployeeBankAccount extends Model
{
    protected $table='sys_employee_bank_accounts';
    protected $fillable=['emp_id','bank_name','branch_name','account_name','account_number','ifsc_code','pan_no'];
    
    
     public function employee()
    {
        return $this->belongsTo('App\Employee');
    }
    
}

class Employee extends Model
{
    protected $table = 'sys_employee';

    /* designation  Function Start Here */
    public function designation_name()
    {
        return $this->hasOne('App\Designation','id','designation');
    }

    /* department  Function Start Here */
    public function department_name()
    {
        return $this->hasOne('App\Department','id','department');
    }
    
    
    
}

$csvpayroll=EmployeeBankAccount::with('employee')->get();

DigiProduct's avatar

When you are writing any reply, the reply popup has a little message at the bottom left of the screen which says "Use Markdown with GitHub-flavored code blocks." .... and the "GitHub-flavored" is a hyperlink.

If you click that it shows you the correct backticks, so you can copy them and paste them back into your reply.

I always do that so that I don't use the wrong thing ... and I also don't have to remember what to use.

Please or to participate in this conversation.