<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class FirmType extends Model
{
    use HasFactory;

    protected $guarded = [];

    public function verify(FirmType $firmType)
    {
        $firmType->update([
            "verified" => true,
        ]);
    }

    public function firms()
    {
        return $this->hasMany(Firm::class);
    }

    public function getVerifiedFirmTypes()
    {
        return FirmType::all()->where('verified', true);
    }
}
