archetecture security fix
This commit is contained in:
@@ -4,9 +4,12 @@ namespace App\Services\Administrator;
|
||||
|
||||
use App\Models\Configuration;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AdministratorSharedService
|
||||
{
|
||||
protected ?bool $teacherClassHasSemesterColumn = null;
|
||||
|
||||
public function __construct(
|
||||
protected Configuration $configuration
|
||||
) {
|
||||
@@ -150,4 +153,13 @@ class AdministratorSharedService
|
||||
|
||||
return count(array_unique($ids));
|
||||
}
|
||||
|
||||
public function teacherClassSupportsSemester(): bool
|
||||
{
|
||||
if ($this->teacherClassHasSemesterColumn !== null) {
|
||||
return $this->teacherClassHasSemesterColumn;
|
||||
}
|
||||
|
||||
return $this->teacherClassHasSemesterColumn = Schema::hasColumn('teacher_class', 'semester');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user