<?php

namespace App;

use App\Laptop;
use App\Instructor;
use Illuminate\Database\Eloquent\Model;

class Loan extends Model
{
    protected $fillable = [
        'is_active','novedad','descripcion','id_laptops','id_instructors'
    ];

    public function laptop(){
        return $this->belongsTo(Laptop::class, 'id_laptops');
    }

    public function instructor(){
        return $this->belongsTo(Instructor::class, 'id_instructors');
    }
}

{'avg_line_length': 19.47826086956522, 'max_line_length': 73, 'alphanum_fraction': 0.6651785714285714, 'licenses': ['MIT'], 'repository_name': 'andresfbetancur/almacen', 'path': 'app/Loan.php', 'size': 448, 'lang': 'PHP'}