FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
framework/src/Foundation/Controller.php at 3.0 · fondbot/framework · GitHub
fondbot
/
framework
Public
Notifications
You must be signed in to change notification settings
Fork
15
Star
123
Code
Issues
1
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
framework
/
src
/
Foundation
/
Controller.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (27 loc) · 947 Bytes
Breadcrumbs
framework
/
src
/
Foundation
/
Controller.php
Copy path
File metadata and controls
35 lines (27 loc) · 947 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare
(strict_types=
1
);
namespace
FondBot
\
Foundation
;
use
Illuminate
\
Http
\
Request
;
use
Illuminate
\
Contracts
\
Events
\
Dispatcher
;
use
FondBot
\
Contracts
\
Channels
\
WebhookVerification
;
class
Controller
{
public
function
index
():
string
{
return
'
FondBot v
'
.Kernel::
VERSION
;
}
public
function
webhook
(
Kernel
$
kernel
,
Dispatcher
$
events
,
Request
$
request
)
{
$
driver
=
$
kernel
->
getChannel
()->
getDriver
();
// If driver supports webhook verification
// We need to check if current request belongs to verification process
if
(
$
driver
instanceof
WebhookVerification &&
$
driver
->
isVerificationRequest
(
$
request
)) {
return
$
driver
->
verifyWebhook
(
$
request
);
}
// Resolve event from driver and dispatch it
$
events
->
dispatch
(
$
event
=
$
driver
->
createEvent
(
$
request
)
);
return
$
driver
->
createResponse
(
$
request
,
$
event
);
}
}
Back
|
FazBrowse Home
|
New Git URL