mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 06:34:34 -04:00
* Refactor pivot table accessors * Add select2 for client - country selector * Fixes for client contact update * implement ctrans() function across application * Increase custom fields to 4 across the application * Refactor: remove repos calling other repos, implement 4 custom values across application * include querying the custom values in the client list * Fix null custom value labels * Scaffold for client - show view * Working on Client Show
43 lines
842 B
PHP
43 lines
842 B
PHP
<?php
|
|
|
|
namespace App\Jobs\Client;
|
|
|
|
|
|
use App\Models\Client;
|
|
use App\Repositories\ClientRepository;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Http\Request;
|
|
|
|
class UpdateClient
|
|
{
|
|
use Dispatchable;
|
|
|
|
protected $request;
|
|
|
|
protected $client;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
|
|
public function __construct(Request $request, Client $client)
|
|
{
|
|
$this->request = $request;
|
|
$this->client = $client;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle(ClientRepository $clientRepo, ClientContactRepository $clientContactRepo) : ?Client
|
|
{
|
|
$client = $clientRepo->save($this->request, $this->client);
|
|
|
|
$contacts = $clientContactRepo->save($this->request->input('contacts'), $client);
|
|
}
|
|
}
|