From 34ac751017aaeb0de934357e8d34da18194d6549 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 6 May 2021 16:07:19 +0800 Subject: [PATCH] big commit --- .../Modules/Companies/Services/CreatesCompanyConnection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Companies/Services/CreatesCompanyConnection.php b/app/Classes/Modules/Companies/Services/CreatesCompanyConnection.php index e3297acf..1e317177 100644 --- a/app/Classes/Modules/Companies/Services/CreatesCompanyConnection.php +++ b/app/Classes/Modules/Companies/Services/CreatesCompanyConnection.php @@ -5,14 +5,16 @@ namespace App\Classes\Modules\Companies\Services; use App\Classes\General\Services\GeneratesInitials; use App\Classes\Modules\Companies\DataTransferObjects\ConnectionObject; use App\Classes\ValueObjects\Constants\ConnectionStatus; +use App\Models\CompanyConnections; class CreatesCompanyConnection { public function execute(ConnectionObject $connection){ + $markingCount = CompanyConnections::all()->count() + 3000; $connection->getInviter()->connections()->attach($connection->getInvitee(), [ - 'marking' => mt_rand(3000, 9999).(new GeneratesInitials())->name($connection->getInviter()->company->name)->length(3)->generate(), + 'marking' => $markingCount.(new GeneratesInitials())->name($connection->getInviter()->company->name)->length(3)->generate(), 'status' => ConnectionStatus::APPROVED, 'instigator' => $connection->getInvitee()->id ]