<?php

namespace App\Models;

use App\Models\ProgrammingLanguage;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class KaaliiPackageVersion extends Model
{
    use HasFactory;

    protected $fillable = ['tech_stack', 'version', 'file_base64', 'path','status'];

    public function scopePublished($query)
    {
        return $query->where('status', 'published');
    }
    public function techStack()
    {
        return $this->belongsTo(ProgrammingLanguage::class, 'tech_stack', 'id');
    }

}
