big commit

This commit is contained in:
omair saleh
2021-05-06 16:07:19 +08:00
parent 60490db66d
commit 34ac751017
@@ -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
]