mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 02:57:45 +00:00
All code for reminders based on piggy banks. I hope.
This commit is contained in:
@@ -302,4 +302,26 @@ 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));
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -23,4 +23,9 @@ interface ToolkitInterface
|
||||
*/
|
||||
public function getDateRangeDates();
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getReminders();
|
||||
|
||||
}
|
Reference in New Issue
Block a user