Last active
December 4, 2016 15:46
-
-
Save makoru-hikage/78dd50841352af65d8c097601bf920e2 to your computer and use it in GitHub Desktop.
This shows "Fatal error: Maximum function nesting level of '256' reached, aborting!"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getAcademicYearAttribute(){ | |
$year_start = Carbon::parse($this->date_start)->year; | |
$year_end = Carbon::parse($this->date_end)->year; | |
$academic_year = | |
self::select(['date_start','date_end', 'semester']) | |
->whereYear('date_start', $year_start) | |
->where(function($q) use ($year_end){ | |
$q->whereYear('date_end', '>=', $year_end) | |
->whereYear('date_end', '<=', $year_end + 1); | |
})->get(); | |
return $academic_year; | |
} | |
//This is a cae of wrong loop, the one that goes forever |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment