1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Repositories/ClientRepository.php
David Bomba 7ee295ec44
JS Form abstraction (#2542)
* added npm package to resolve typescript dependencies

* OO JS forms

*  OO forms

* Refactors forms to abstract form CRUD

* Working on Promises

* Fix for errors in js form

* Form validation with array of data

* Client update validation - array

* handle array validation

* Toastr notifications

* Clean up
2018-12-05 19:23:12 +11:00

31 lines
617 B
PHP

<?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;
}
}