Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4793150
ReportServiceProvider.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ReportServiceProvider.php
View Options
<?php
namespace
Nasqueron\Notifications\Providers
;
use
Illuminate\Contracts\Events\Dispatcher
;
use
Illuminate\Contracts\Foundation\Application
;
use
Illuminate\Support\ServiceProvider
;
use
Nasqueron\Notifications\Actions\ActionsReport
;
use
Nasqueron\Notifications\Events\ReportEvent
;
class
ReportServiceProvider
extends
ServiceProvider
{
/**
* Registers the application services.
*
* @return void
*/
public
function
register
()
{
$this
->
app
->
singleton
(
'report'
,
function
(
Application
$app
)
{
$report
=
new
ActionsReport
();
static
::
listenToActionsForReport
(
$report
,
$app
[
'events'
]);
return
$report
;
});
}
/**
* Listen to actions fired by the application to add to the report
*
* @param Nasqueron\Notifications\Actions\ActionsReport $report The report to add actions to
* @param Illuminate\Contracts\Events\Dispatcher $events The application events dispatcher
*/
public
static
function
listenToActionsForReport
(
ActionsReport
$report
,
Dispatcher
$events
)
{
$events
->
listen
(
'Nasqueron
\N
otifications
\E
vents
\R
eportEvent'
,
function
(
ReportEvent
$event
)
use
(
$report
)
{
$report
->
addAction
(
$event
->
action
);
}
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Feb 28, 21:39 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2436070
Default Alt Text
ReportServiceProvider.php (1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment