<?php

namespace App\Models;

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

class Widget extends Model
{
    use HasFactory;

     protected $fillable = [
        'name',
        'description',
        'type',
        'subtype',
        'icon',

    ];

    public function deviceControls()
    {
        return $this->belongsToMany(DeviceControl::class, 'widget_device_controls', 'widget_id', 'device_control_id');
    }



}
