mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
commit
9d568de394
@ -204,16 +204,13 @@ class PreviewController extends BaseController
|
||||
|
||||
if($request->has('entity_id')){
|
||||
|
||||
$entity_obj = $class::on($company->db)
|
||||
->where('id', $this->decodePrimaryKey($request->input('entity_id')))
|
||||
$entity_obj = $class::where('id', $this->decodePrimaryKey($request->input('entity_id')))
|
||||
->where('company_id', $company->id)
|
||||
->withTrashed()
|
||||
->first();
|
||||
|
||||
if($entity_obj)
|
||||
info("found a valid entity object");
|
||||
else
|
||||
$entity_obj = $factory;
|
||||
|
||||
$entity_obj = $repo->save($request->all(), $entity_obj);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user