<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * @property $id
 * @property $tool_id
 * @property $option
 * @property $updated_at
 */

 class ToolAdditionalOption extends Model
 {
     protected $table = 'tool_additional_option';
     use SoftDeletes;

     public static function byToolAndOptionNameAndType($toolId, $name, $type) 
     {
         return self::where('tool_id', $toolId)->where('option', $name)->where('type', $type)->first();
     }

     public static function byToolAndOptionIDAndType($toolId, $id, $type) 
     {
         return self::where('tool_id', $toolId)->where('id', $id)->where('type', $type)->first();
     }
 }