protected function academicPeriods()
    {
        if ( ! $this->filtersAppliedToPeriods()) return AcademicPeriod::all();
        if (str_contains($this->filters[0], '-')) {
            try {
                return collect([AcademicPeriod::where(['academic_periods_name' => $this->filters[0]])->firstOrFail()]);
            } catch (\Exception $e) {
                return collect([AcademicPeriod::where(['academic_periods_shortname' => $this->filters[0]])->firstOrFail()]);
            }
        }
        if ( ! is_numeric($this->filters[0])) throw new \InvalidArgumentException();
        return collect([AcademicPeriod::findOrFail(intval($this->filters[0]))]);
    }
protected function academicPeriods()
    {
        if ( ! $this->filtersAppliedToPeriods()) return AcademicPeriod::all();
        if (str_contains($this->filters[0], '-')) {
            try {
                return collect([AcademicPeriod::where(['academic_periods_name' => $this->filters[0]])->firstOrFail()]);
            } catch (\Exception $e) {
                return collect([AcademicPeriod::where(['academic_periods_shortname' => $this->filters[0]])->firstOrFail()]);
            }
        }
        if ( ! is_numeric($this->filters[0])) throw new \InvalidArgumentException();
        return collect([AcademicPeriod::findOrFail(intval($this->filters[0]))]);
    }
protected function academicPeriods ( ) { if ( ! $ this -> filtersAppliedToPeriods ( ) ) return AcademicPeriod :: all ( ) ; if ( str_contains ( $ this -> filters [ 0 ] , '-' ) ) { try { return collect ( [ AcademicPeriod :: where ( [ 'academic_periods_name' => $ this -> filters [ 0 ] ] ) -> firstOrFail ( ) ] ) ; } catch ( \ Exception $ e ) { return collect ( [ AcademicPeriod :: where ( [ 'academic_periods_shortname' => $ this -> filters [ 0 ] ] ) -> firstOrFail ( ) ] ) ; } } if ( ! is_numeric ( $ this -> filters [ 0 ] ) ) throw new \ InvalidArgumentException ( ) ; return collect ( [ AcademicPeriod :: findOrFail ( intval ( $ this -> filters [ 0 ] ) ) ] ) ; }
Get academic periods.

@return \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|static[]
Get academic periods .