mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 04:23:59 +00:00
22 lines
727 B
PHP
22 lines
727 B
PHP
<?php
|
|
|
|
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;
|
|
|
|
class CreatesCompanyConnection
|
|
{
|
|
|
|
public function execute(ConnectionObject $connection){
|
|
$connection->getInviter()->connections()->attach($connection->getInvitee(),
|
|
[
|
|
'marking' => mt_rand(100, 999).(new GeneratesInitials())->name($connection->getInviter()->company->name)->length(3)->generate(),
|
|
'status' => ConnectionStatus::APPROVED,
|
|
'instigator' => $connection->getInvitee()->id
|
|
]
|
|
);
|
|
}
|
|
|
|
} |