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 ]