We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cff6b0 commit a441d15Copy full SHA for a441d15
src/Api/Api.php
@@ -3,6 +3,7 @@
3
namespace Jason\Api;
4
5
use Illuminate\Support\Facades\Auth;
6
+use Jason\Api\Events\ApiLogin;
7
8
class Api
9
{
@@ -56,6 +57,7 @@ public function attempt(array $credentials)
56
57
*/
58
public function login($user)
59
60
+ event(new ApiLogin($user));
61
return Auth::guard(self::GUARD)->login($user);
62
}
63
src/Api/Events/ApiLogin.php
@@ -0,0 +1,23 @@
1
+<?php
2
+
+namespace Jason\Api\Events;
+use Illuminate\Foundation\Events\Dispatchable;
+class ApiLogin
+{
10
+ use Dispatchable;
11
12
+ public $user;
13
14
+ /**
15
+ * 创建一个事件实例
16
+ * @return void
17
+ */
18
+ public function __construct($user)
19
+ {
20
+ $this->user = $user;
21
+ }
22
23
+}
0 commit comments