<?php


namespace App\Repositories;


use App\Discount;

class DiscountRepository implements RepositoryInterface {
    public static function all() {
        return Discount::all();
    }

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

    public static function update(array $data, $id) {
        return Discount::where("id",$id)->update($data);
    }

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

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

    public static function company($id) {
        return Discount::findOrFail($id)->company;
    }
}
