mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
7ee295ec44
* 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
31 lines
617 B
PHP
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;
|
|
}
|
|
|
|
} |