Skip to content

Commit

Permalink
Merge pull request #368 from yungifez/dev
Browse files Browse the repository at this point in the history
Remove set error bag in livewire components
  • Loading branch information
yungifez authored Dec 12, 2023
2 parents 293ac23 + 479ff4f commit fe875bb
Show file tree
Hide file tree
Showing 108 changed files with 751 additions and 1,140 deletions.
2 changes: 0 additions & 2 deletions app/Livewire/AcademicYearResultTabulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class AcademicYearResultTabulation extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

//get semester and use it to fetch all exams in semester
$this->academicYear = auth()->user()->school->academicYear;
$this->classes = $myClassService->getAllClasses();
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/ApplicationHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class ApplicationHistory extends Component

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->applicant->loadMissing('accountApplication', 'accountApplication.statuses');
}

Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/AssignStudentsToParent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class AssignStudentsToParent extends Component

public function mount(SectionService $sectionService, MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->classes = $myClassService->getAllClasses();
if ($this->classes->isEmpty()) {
return;
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/AssignTeacherToSubjects.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class AssignTeacherToSubjects extends Component

public function mount(TeacherService $teacherService, MyClassService $myclassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->classes = $myclassService->getAllClasses();
$this->class = $this->classes->first()?->id;
$this->teachers = $teacherService->getAllTeachers();
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/ChangeAccountApplicationStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class ChangeAccountApplicationStatus extends Component

public function mount(User $applicant)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->applicant = $applicant;

//return null if no applicant record
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateAcademicYearForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateAcademicYearForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-academic-year-form');
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateAdminForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-admin-form');
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/CreateClassForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class CreateClassForm extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
$this->classGroups = $myClassService->getAllClassGroups();
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateClassGroupForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateClassGroupForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-class-group-form');
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateCustomTimetableItemForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateCustomTimetableItemForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-custom-timetable-item-form');
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/CreateExamForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class CreateExamForm extends Component

public function mount(SemesterService $semesterService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
$this->semesters = $semesterService->getAllSemestersInAcademicYear(auth()->user()->school->academic_year_id);
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateExamSlotForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class CreateExamSlotForm extends Component
{
public Exam $exam;

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-exam-slot-form');
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateFeeCategoryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateFeeCategoryForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-fee-category-form');
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/CreateFeeForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class CreateFeeForm extends Component

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->feeCategories = FeeCategory::where('school_id', auth()->user()->school_id)->get();
}

Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/CreateFeeInvoiceForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class CreateFeeInvoiceForm extends Component

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->addedFees = collect();
$this->addedStudents = collect();
$this->feeCategories = FeeCategory::where('school_id', auth()->user()->school_id)->get();
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/CreateGradeSystemForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class CreateGradeSystemForm extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->classGroups = $myClassService->getAllClassGroups();
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateNoticeForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateNoticeForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-notice-form');
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateParentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateParentForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-parent-form');
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateSchoolForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateSchoolForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-school-form');
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/CreateSectionForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class CreateSectionForm extends Component

public function mount(MyClassService $classService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->myClasses = $classService->getAllClasses();
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateSemesterForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateSemesterForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateStudentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateStudentForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-student-form');
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/CreateStudentRecordFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CreateStudentRecordFields extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
$this->myClasses = $myClassService->getAllClasses();

if ($this->myClasses->isNotEmpty()) {
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/CreateSubjectForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class CreateSubjectForm extends Component

public function mount(MyClassService $myClassService, TeacherService $teacherService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
$this->classes = $myClassService->getAllClasses();
$this->teachers = $teacherService->getAllTeachers();
}
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/CreateSyllabusForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class CreateSyllabusForm extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
$this->classes = $myClassService->getAllClasses();
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateTeacherForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class CreateTeacherForm extends Component
{
public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-teacher-form');
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/CreateTimetableForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class CreateTimetableForm extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->classes = $myClassService->getAllClasses();
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/CreateUserFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ class CreateUserFields extends Component
{
public string $role = 'User';

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.create-user-fields');
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/DashboardDataCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class DashboardDataCards extends Component

public function mount(SectionService $sectionService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->schools = School::count();
$this->classGroups = auth()->user()->school->classGroups()->count();
$this->classes = auth()->user()->school->myClasses()->count();
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/EditAcademicYearForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class EditAcademicYearForm extends Component
{
public AcademicYear $academicYear;

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.edit-academic-year-form');
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/EditAccountApplicationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class EditAccountApplicationForm extends Component

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
$this->roles = Role::whereIn('name', ['teacher', 'student', 'parent'])->get();
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/EditAdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class EditAdminForm extends Component
{
public User $admin;

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.edit-admin-form');
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/EditClassForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class EditClassForm extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
$this->classGroups = $myClassService->getAllClassGroups();
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/EditClassGroupForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class EditClassGroupForm extends Component
{
public ClassGroup $classGroup;

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.edit-class-group-form');
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/EditCustomTimetableItemForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class EditCustomTimetableItemForm extends Component
{
public CustomTimetableItem $customTimetableItem;

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.edit-custom-timetable-item-form');
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/EditExamForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class EditExamForm extends Component

public function mount(SemesterService $semesterService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->semesters = $semesterService->getAllSemestersInAcademicYear(auth()->user()->school->academic_year_id);
}

Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/EditExamSlotForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ class EditExamSlotForm extends Component

public ExamSlot $examSlot;

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.edit-exam-slot-form');
Expand Down
5 changes: 0 additions & 5 deletions app/Livewire/EditFeeCategoryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class EditFeeCategoryForm extends Component
{
public FeeCategory $feeCategory;

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());
}

public function render()
{
return view('livewire.edit-fee-category-form');
Expand Down
Loading

0 comments on commit fe875bb

Please sign in to comment.