<?php


namespace App\Repositories;


use App\CompanyOrder;

class CompanyOrderRepository {
    public static function all() {
        return CompanyOrder::all();
    }

    public static function find($id){
        return CompanyOrder::findOrFail($id);
    }

    public static function create(array $data) {
        return CompanyOrder::create($data);
    }

    public static function update(array $data, $id) {
        CompanyOrder::findOrFail($id)->update($data);
        return CompanyOrder::findOrFail($id);
    }

    public static function delete($id){
        return CompanyOrder::destroy($id);
    }
}
