<?php

namespace App\Repositories\Sale;

use App\Models\PaymentPlans;

class PaymentPlansRepository implements PaymentPlansRepositoryInterface
{
    public function all(){
        return PaymentPlans::all();
    }

    public function find($id){
        return PaymentPlans::find($id);
    }

    public function create($data){
        return PaymentPlans::create($data);
    }

    public function update($id, $data){
        return PaymentPlans::find($id)->update($data);
    }

    public function getBySale($sale_id){
        return PaymentPlans::where('sales_id',$sale_id)->get();
    }
}
