- Fully transitioned the backend to the Porto architectural pattern - Improved code organization and maintainability - Fixed minor bugs and inconsistencies
31 lines
749 B
PHP
31 lines
749 B
PHP
<?php
|
|
|
|
namespace App\Containers\InstituteStructure\Models;
|
|
|
|
use App\Containers\User\Models\User;
|
|
use App\Ship\Contracts\SeoDescriptionInterface;
|
|
use App\Ship\Models\Model;
|
|
use App\Ship\Traits\HasSeo;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class Division extends Model implements SeoDescriptionInterface
|
|
{
|
|
use HasFactory, HasSeo;
|
|
|
|
protected $guarded = false;
|
|
|
|
protected $casts = [
|
|
'description' => 'array',
|
|
];
|
|
|
|
public function workers()
|
|
{
|
|
return $this->belongsToMany(User::class, 'division_user')->withPivot(['administrativePosition', 'sort', 'service_email', 'service_phone', 'cabinet']);
|
|
}
|
|
|
|
public function getSeoDescription(): array
|
|
{
|
|
return $this->description;
|
|
}
|
|
}
|