File "License.php"

Full Path: /home/isoftco/public_html/hrm/app/Models/License.php
File size: 495 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class License extends Model
{

    protected $table = "licenses";
    protected $primaryKey = 'license_number';
    public static $rules = ['license_number' => 'required', 'name' => 'required', 'email' => 'required'];

    public static function licenseCount($type)
    {
        return License::join('license_types', 'license_types.id', '=', 'licenses.license_type_id')
            ->where('type', $type)->count();
    }
}