<?php
namespace App\Repositories\Eloquent;

use App\Models\Report;
use App\Repositories\Contracts\ReportRepositoryInterface;
use Illuminate\Http\Request;

class ReportRepository implements ReportRepositoryInterface
{

    public function all(Request $request)
    {
        if ($request->has('search')) {
            return Report::search($request->search)->get();
        }

        return Report::get();
    }

    public function create(array $properties)
    {
        return Report::create($properties);
    }

    public function update($report, array $properties)
    {
        return $report->update($properties);
    }

    public function delete($report)
    {
        return $report->delete();
    }
  }