mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Listen to the logout event. #219
This commit is contained in:
@@ -32,20 +32,20 @@ class EventServiceProvider extends ServiceProvider
|
||||
= [
|
||||
'FireflyIII\Events\TransactionJournalUpdated' => [
|
||||
'FireflyIII\Handlers\Events\ScanForBillsAfterUpdate',
|
||||
|
||||
'FireflyIII\Handlers\Events\UpdateJournalConnection',
|
||||
'FireflyIII\Handlers\Events\FireRulesForUpdate',
|
||||
|
||||
],
|
||||
'FireflyIII\Events\TransactionJournalStored' => [
|
||||
'FireflyIII\Handlers\Events\ScanForBillsAfterStore',
|
||||
|
||||
'FireflyIII\Handlers\Events\ConnectJournalToPiggyBank',
|
||||
'FireflyIII\Handlers\Events\FireRulesForStore',
|
||||
],
|
||||
'Illuminate\Auth\Events\Logout' => [
|
||||
'FireflyIII\Handlers\Events\UserEventListener@onUserLogout',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Register any other events for your application.
|
||||
*
|
||||
@@ -93,6 +93,26 @@ class EventServiceProvider extends ServiceProvider
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function registerCreateEvents()
|
||||
{
|
||||
|
||||
// move this routine to a filter
|
||||
// in case of repeated piggy banks and/or other problems.
|
||||
PiggyBank::created(
|
||||
function (PiggyBank $piggyBank) {
|
||||
$repetition = new PiggyBankRepetition;
|
||||
$repetition->piggyBank()->associate($piggyBank);
|
||||
$repetition->startdate = is_null($piggyBank->startdate) ? null : $piggyBank->startdate;
|
||||
$repetition->targetdate = is_null($piggyBank->targetdate) ? null : $piggyBank->targetdate;
|
||||
$repetition->currentamount = 0;
|
||||
$repetition->save();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -121,24 +141,4 @@ class EventServiceProvider extends ServiceProvider
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function registerCreateEvents()
|
||||
{
|
||||
|
||||
// move this routine to a filter
|
||||
// in case of repeated piggy banks and/or other problems.
|
||||
PiggyBank::created(
|
||||
function (PiggyBank $piggyBank) {
|
||||
$repetition = new PiggyBankRepetition;
|
||||
$repetition->piggyBank()->associate($piggyBank);
|
||||
$repetition->startdate = is_null($piggyBank->startdate) ? null : $piggyBank->startdate;
|
||||
$repetition->targetdate = is_null($piggyBank->targetdate) ? null : $piggyBank->targetdate;
|
||||
$repetition->currentamount = 0;
|
||||
$repetition->save();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user