Large commit

This commit is contained in:
omair saleh
2021-08-16 08:59:26 +08:00
parent e2874f7199
commit d8c767c670
260 changed files with 4657 additions and 2960 deletions
+23
View File
@@ -5,12 +5,14 @@ namespace App\Models;
use App\Classes\General\Interfaces\Addressable;
use App\Classes\General\Interfaces\Contactable;
use App\Classes\General\Interfaces\Documentable;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BusinessType;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -65,6 +67,27 @@ class CompanyModule extends AbstractModel implements Addressable, Documentable,
return $this->belongsToMany(User::class, (new CompanyEmployee())->getTable(), 'company_module_id', 'user_id');
}
/**
* @return belongsToMany
*/
public function invites(): belongsToMany
{
return $this->belongsToMany(CompanyModule::class, CompanyConnection::class,'inviter_id', 'invitee_id');
}
/**
* @return belongsToMany
*/
public function inviters(): belongsToMany
{
return $this->belongsToMany(CompanyModule::class, CompanyConnection::class,'invitee_id', 'inviter_id');
}
public function connections(): hasMany {
return $this->hasMany(CompanyConnection::class, 'invitee_id');
}
/**
* @return HasMany
*/