Skip to content

Commit f252d05

Browse files
authored
Merge pull request #5 from rappasoft/develop
v1.1.0
2 parents 015d2f9 + e26d2d8 commit f252d05

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to `Laravel Authentication Log` will be documented in this file.
44

5+
### 1.1.0 - 2021-10-11
6+
7+
### Added
8+
9+
- Known issues section to readme
10+
- Ability to set DB connection type - https://github.com/rappasoft/laravel-authentication-log/pull/4
11+
512
## 1.0.0 - 2021-09-30
613

714
- Initial Release

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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
@@ -227,7 +230,7 @@ class AuthenticationLog extends DataTableComponent
227230
->orWhere('location->state_name', 'like', '%'.$searchTerm.'%')
228231
->orWhere('location->postal_code', 'like', '%'.$searchTerm.'%');
229232
})
230-
->format(fn($value) => $value['default'] === false ? $value['city'] . ', ' . $value['state'] : '-'),
233+
->format(fn ($value) => $value && $value['default'] === false ? $value['city'] . ', ' . $value['state'] : '-'),
231234
Column::make('Login At')
232235
->sortable()
233236
->format(fn($value) => $value ? timezone()->convertToLocal($value) : '-'),
@@ -260,6 +263,10 @@ Example:
260263

261264
![Example Log Table](https://imgur.com/B4DlN4W.png)
262265

266+
## Known Issues
267+
268+
- [This cache store is not supported. - torann/geoip](https://github.com/Torann/laravel-geoip/issues/147#issuecomment-528414630)
269+
263270
## Testing
264271

265272
```bash

config/authentication-log.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
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

src/Models/AuthenticationLog.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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());

0 commit comments

Comments
 (0)