mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-22 12:04:00 +00:00
This will be the first release!
This commit is contained in:
@@ -64,6 +64,29 @@ class Toolkit implements ToolkitInterface
|
||||
return [\Session::get('start'), \Session::get('end')];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getReminders()
|
||||
{
|
||||
// get reminders, for menu, mumble mumble:
|
||||
$today = new Carbon;
|
||||
$reminders = \Auth::user()->reminders()->where('class', 'PiggybankReminder')->validOn($today)->get();
|
||||
|
||||
/** @var \Reminder $reminder */
|
||||
foreach ($reminders as $index => $reminder) {
|
||||
if (\Session::has('dismissal-' . $reminder->id)) {
|
||||
$time = \Session::get('dismissal-' . $reminder->id);
|
||||
if ($time >= $today) {
|
||||
unset($reminders[$index]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
\Session::put('reminderCount', count($reminders));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -302,26 +325,4 @@ class Toolkit implements ToolkitInterface
|
||||
return $end;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getReminders() {
|
||||
// get reminders, for menu, mumble mumble:
|
||||
$today = new Carbon;
|
||||
$reminders = \Auth::user()->reminders()->validOn($today)->get();
|
||||
|
||||
/** @var \Reminder $reminder */
|
||||
foreach($reminders as $index => $reminder) {
|
||||
if(\Session::has('dismissal-' . $reminder->id)) {
|
||||
$time = \Session::get('dismissal-' . $reminder->id);
|
||||
if($time >= $today) {
|
||||
unset($reminders[$index]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
\Session::put('reminderCount',count($reminders));
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user