diff --git a/app/Http/Controllers/DesignController.php b/app/Http/Controllers/DesignController.php index 520783a9ad1e..49cfa40c00e4 100644 --- a/app/Http/Controllers/DesignController.php +++ b/app/Http/Controllers/DesignController.php @@ -25,6 +25,7 @@ use App\Transformers\DesignTransformer; use App\Utils\Traits\MakesHash; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Illuminate\Support\Str; /** * Class DesignController. @@ -412,6 +413,7 @@ class DesignController extends BaseController { //may not need these destroy routes as we are using actions to 'archive/delete' $design->is_deleted = true; + $design->name = $design->name . "_deleted_" . Str::random(5); $design->delete(); $design->save(); diff --git a/app/Repositories/DesignRepository.php b/app/Repositories/DesignRepository.php index ccee45fa23bd..94abd2b70a9f 100644 --- a/app/Repositories/DesignRepository.php +++ b/app/Repositories/DesignRepository.php @@ -11,9 +11,22 @@ namespace App\Repositories; +use App\Models\Design; +use Illuminate\Support\Str; + /** * Class for DesignRepository . */ class DesignRepository extends BaseRepository { + + public function delete($design) :Design + { + + $design->name = $design->name . "_deleted_" . Str::random(5); + + parent::delete($design); + + return $design; + } } diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 16ee438340f4..976ff0783fb5 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -232,6 +232,10 @@ class HtmlEngine $data['$client2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client2', $this->client->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client2')]; $data['$client3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client3', $this->client->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client3')]; $data['$client4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client4', $this->client->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client4')]; + $data['$client.custom1'] = &$data['$client1']; + $data['$client.custom2'] = &$data['$client2']; + $data['$client.custom3'] = &$data['$client3']; + $data['$client.custom4'] = &$data['$client4']; $data['$address1'] = ['value' => $this->client->address1 ?: ' ', 'label' => ctrans('texts.address1')]; $data['$address2'] = ['value' => $this->client->address2 ?: ' ', 'label' => ctrans('texts.address2')]; $data['$id_number'] = ['value' => $this->client->id_number ?: ' ', 'label' => ctrans('texts.id_number')];