<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;


class Contratti extends Model
{
    use HasFactory;

    protected $fillable=[
        'numero',
        'nome',
        'datainizio',
        'datatermine',
        'fornitore',
        'tipo',
        'importo',
        'scadenzapagamento',
        'stato',
        'note',
        'filename'
    ];


    public static function storeContratto(Request $req){
        /* dd($req); */
            
    }

    public static function getAllContratto(){
        return self::all();
    }

    public static function getContrattoById($id){
        return DB::table('contrattis')->where('id','=',$id)->get();
    }

}
