File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ return [
4646 // You can change this if the database keys get too long for your driver
4747 'table_name' => 'authentication_log',
4848
49+ // The database connection where the authentication_log table resides. Leave empty to use the default
50+ 'db_connection' => null,
51+
4952 'notifications' => [
5053 'new-device' => [
5154 // Send the NewDevice notification
Original file line number Diff line number Diff line change 55 // You can change this if the database keys get too long for your driver
66 'table_name ' => 'authentication_log ' ,
77
8+ // The database connection where the authentication_log table resides. Leave empty to use the default
9+ 'db_connection ' => null ,
10+
811 'notifications ' => [
912 'new-device ' => [
1013 // Send the NewDevice notification
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class AuthenticationLog extends Model
1010 public $ timestamps = false ;
1111
1212 protected $ table = 'authentication_log ' ;
13-
13+
1414 protected $ fillable = [
1515 'ip_address ' ,
1616 'user_agent ' ,
@@ -32,6 +32,15 @@ class AuthenticationLog extends Model
3232 'logout_at ' ,
3333 ];
3434
35+ public function __construct (array $ attributes = [])
36+ {
37+ if (! isset ($ this ->connection )) {
38+ $ this ->setConnection (config ('authentication-log.db_connection ' ));
39+ }
40+
41+ parent ::__construct ($ attributes );
42+ }
43+
3544 public function getTable ()
3645 {
3746 return config ('authentication-log.table_name ' , parent ::getTable ());
You can’t perform that action at this time.
0 commit comments