Fixes the tests.

This commit is contained in:
James Cole
2014-08-20 18:12:40 +02:00
parent c272d99fa8
commit 119930399a
2 changed files with 8 additions and 5 deletions

View File

@@ -10,7 +10,6 @@ class BaseController extends Controller
*
*/
public function __construct() {
parent::__construct();
Event::fire('limits.check');
}
/**

View File

@@ -19,10 +19,14 @@ class EloquentLimitTrigger
*/
public function checkRepeatingLimits()
{
$limits = \Limit::leftJoin('components', 'components.id', '=', 'limits.component_id')
->where('components.user_id', \Auth::user()->id)
->where('limits.repeats', 1)
->get(['limits.*']);
if (\Auth::check()) {
$limits = \Limit::leftJoin('components', 'components.id', '=', 'limits.component_id')
->where('components.user_id', \Auth::user()->id)
->where('limits.repeats', 1)
->get(['limits.*']);
} else {
$limits = [];
}
/** @var \Limit $limit */
foreach ($limits as $limit) {