2024-01-10 12:56:02 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories\SQL;
|
|
|
|
|
|
|
|
use App\Models\Car;
|
|
|
|
use App\Repositories\Interfaces\CarRepositoryInterface;
|
|
|
|
|
|
|
|
class CarRepository implements CarRepositoryInterface
|
|
|
|
{
|
|
|
|
|
|
|
|
public function getAllCars()
|
|
|
|
{
|
2024-01-30 11:21:30 +04:00
|
|
|
return Car::all();
|
2024-01-10 12:56:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function createCar(array $data)
|
|
|
|
{
|
|
|
|
Car::create($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function updateCar(Car $car, array $data)
|
|
|
|
{
|
|
|
|
$car->update($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function deleteCar(Car $car)
|
|
|
|
{
|
|
|
|
$car->delete();
|
|
|
|
}
|
|
|
|
}
|