1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00
invoiceninja/app/Repositories/ClientRepository.php

31 lines
617 B
PHP
Raw Normal View History

<?php
namespace App\Repositories;
use App\Models\Client;
use App\Repositories\ClientContactRepository;
use Illuminate\Http\Request;
/**
*
*/
class ClientRepository extends BaseRepository
{
protected $clientContactRepo;
public function __construct(ClientContactRepository $clientContactRepo)
{
$this->clientContactRepo = $clientContactRepo;
}
public function save(Request $request, Client $client) : ?Client
{
$client->fill($request->input());
$client->save();
$this->clientContactRepo->save($request->input('contacts'), $client);
return $client;
}
}