51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Api;
|
|
|
|
class StationService extends BaseApiService
|
|
{
|
|
public function getAllStations(array $params = [])
|
|
{
|
|
return $this->get('/stations', $params);
|
|
}
|
|
|
|
public function getStation($id)
|
|
{
|
|
return $this->get("/stations/{$id}");
|
|
}
|
|
|
|
public function createStation(array $data)
|
|
{
|
|
return $this->post('/stations', $data, true); // true for file upload support
|
|
}
|
|
|
|
public function updateStation($id, array $data)
|
|
{
|
|
return $this->post("/stations/{$id}", array_merge($data, ['_method' => 'PUT']), true);
|
|
}
|
|
|
|
public function deleteStation($id)
|
|
{
|
|
return $this->post("/stations/{$id}", ['_method' => 'DELETE']);
|
|
}
|
|
|
|
public function getFuelPrices(array $params = [])
|
|
{
|
|
return $this->get('/stations/fuel-prices', $params);
|
|
}
|
|
|
|
public function updateFuelPrices(array $data)
|
|
{
|
|
return $this->post('/stations/fuel-prices', $data);
|
|
}
|
|
|
|
public function getFuelPriceSchedule(array $params = [])
|
|
{
|
|
return $this->get('/stations/fuel-prices/schedule', $params);
|
|
}
|
|
|
|
public function createFuelPriceSchedule(array $data)
|
|
{
|
|
return $this->post('/stations/fuel-prices/schedule', $data);
|
|
}
|
|
}
|