<?php

namespace Modules\Brand\Repositories;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Modules\Brand\Interfaces\BrandRepositoryInterface;
use Modules\Brand\Models\Brand;
class BrandRepository implements BrandRepositoryInterface
{
    public function get(array $request):Builder
    {
        return Brand::query();
    }


    public function create(string $image): Brand
    {
        return Brand::create(['image'=>$image]);
    }

    public function insert(array $data): bool
    {
        return Brand::insert($data);
    }

    public function getAll() : ?Collection
    {
        return Brand::select('id', 'image')->get();
    }

    public function deleteAll($ids= []):void
    {
        Brand::whereIn('id', $ids)->delete();
    }

}
