File: /var/www/ipsremont-demo/app/Services/Movement/MovementService.php
<?php
namespace App\Services\Movement;
use App\Http\Requests\Movement\IndexRequest;
use App\Repository\Movement\MovementRepository;
class MovementService
{
protected MovementRepository $repository;
public function __construct(MovementRepository $movementRepository)
{
$this->repository = $movementRepository;
}
/**
* @param IndexRequest $request
*
* @return mixed
*/
public function search(IndexRequest $request)
{
return $this->repository->search($request);
}
public static function addMovement($part_id, $repair_id, $amount, $type, $service_id)
{
$data = [
'part_id' => $part_id,
'repair_id' => $repair_id,
'amount' => $amount,
'type' => $type,
'service_id' => $service_id,
];
MovementRepository::addMovement($data);
}
}