File: /home/mmickelson/spilicensing/app/License.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class License extends Model
{
    protected $fillable = ['licenseKey', 'licenseType_id', 'maxActivations', 'product_id', 'subproduct_id', 'expiration', 'duration', 'vendor_id', 'batch'];
    protected $casts = [
        'maxActivations' => 'integer'
    ];
    public function licenseType() {
        return $this->belongsTo('App\LicenseType', 'licenseType_id');
    }
    public function product() {
        return $this->belongsTo('App\Product', 'product_id');
    }
    public function subproduct() {
        return $this->belongsTo('App\Subproduct', 'subproduct_id');
    }
    public function vendor() {
        return $this->belongsTo('App\Vendor', 'vendor_id');
    }
    public function purchaser() {
        return $this->belongsTo('App\Purchaser', 'purchaser_id');
    }
    public function systems() {
        return $this->belongsToMany('App\System');
    }
}