-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1504b24
Showing
16 changed files
with
608 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: PHP Linting (Pint) | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/npm_and_yarn/*' | ||
jobs: | ||
phplint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: "laravel-pint" | ||
uses: aglipanci/laravel-pint-action@0.1.0 | ||
with: | ||
preset: laravel | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: PHP Linting (Pint) | ||
skip_fetch: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: 'Update Changelog' | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
|
||
- name: Update Changelog | ||
uses: stefanzweifel/changelog-updater-action@v1 | ||
with: | ||
latest-version: ${{ github.event.release.name }} | ||
release-notes: ${{ github.event.release.body }} | ||
|
||
- name: Commit updated CHANGELOG | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: ${{ github.event.release.target_commitish }} | ||
commit_message: Update CHANGELOG | ||
file_pattern: CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/node_modules | ||
/vendor | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
auth.json | ||
npm-debug.log | ||
yarn-error.log | ||
/.idea | ||
/.vscode | ||
/build | ||
/coverage | ||
.DS_Store | ||
composer.phar | ||
phpunit.xml | ||
phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Changelog | ||
|
||
All notable changes to the "Filament Authentication Log" will be documented in this file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Filament Authentication Log | ||
|
||
A Filament plugin for [Laravel Authentication Log](https://github.com/rappasoft/laravel-authentication-log) package. | ||
|
||
This package provides a Filament resource and a relation manager for [Laravel Authentication Log](https://github.com/rappasoft/laravel-authentication-log). | ||
|
||
## Requirements | ||
- PHP 8.1 | ||
- [Filament 3](https://github.com/laravel-filament/filament) | ||
|
||
## Dependencies | ||
- [rappasoft/laravel-authentication-log](https://github.com/rappasoft/laravel-authentication-log) | ||
|
||
## Installation | ||
|
||
You can install the plugin via Composer: | ||
|
||
```bash | ||
composer require tapp/filament-authentication-log:"^3.0" | ||
``` | ||
|
||
> **Note** | ||
> For **Filament 2.x** check the **[2.x](https://github.com//TappNetwork/filament-authentication-log/tree/2.x)** branch | ||
You can publish the translations files with: | ||
|
||
```bash | ||
php artisan vendor:publish --tag="filament-authentication-log-translations" | ||
``` | ||
|
||
You can publish the config file with: | ||
|
||
```bash | ||
php artisan vendor:publish --tag="filament-authentication-log-config" | ||
``` | ||
|
||
## Using the Resource | ||
|
||
Add this plugin to a panel on `plugins()` method. | ||
E.g. in `app/Providers/Filament/AdminPanelProvider.php`: | ||
|
||
```php | ||
use Tapp\FilamentAuthenticationLog\FilamentAuthenticationLogPlugin; | ||
|
||
public function panel(Panel $panel): Panel | ||
{ | ||
return $panel | ||
// ... | ||
->plugins([ | ||
FilamentAuthenticationLogPlugin::make(), | ||
//... | ||
]); | ||
} | ||
``` | ||
|
||
That's it! Now you can see the Authentication Log resource on left sidebar. | ||
|
||
### Resource appareance | ||
|
||
![Filament Authentication Log Resource](https://raw.githubusercontent.com/TappNetwork/filament-authentication-log/main/docs/resource01.png) | ||
|
||
![Filament Authentication Log Resource with filters and tooltip](https://raw.githubusercontent.com/TappNetwork/filament-authentication-log/main/docs/resource02.png) | ||
|
||
|
||
## Using the Relation Manager | ||
|
||
Add the `Tapp\FilamentAuthenticationLog\RelationManagers\` to the `getRelations()` method on the Filament resource where the model uses the `AuthenticationLoggable` trait. | ||
|
||
E.g. in `App\Filament\Resources\UserResource.php`: | ||
|
||
```php | ||
use Tapp\FilamentAuthenticationLog\RelationManagers\AuthenticationLogsRelationManager; | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
AuthenticationLogsRelationManager::class, | ||
// ... | ||
]; | ||
} | ||
``` | ||
|
||
### Relation manager appareance | ||
|
||
![Filament Authentication Log Relation Manager](https://raw.githubusercontent.com/TappNetwork/filament-authentication-log/main/docs/relation_manager.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"name": "tapp/filament-authentication-log", | ||
"description": "Filament authentication log plugin.", | ||
"keywords": [ | ||
"tapp network", | ||
"filament", | ||
"authentication", | ||
"log", | ||
"resource", | ||
"relation manager" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Tapp Network", | ||
"email": "steve@tappnetwork.com", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "Tapp Network", | ||
"email": "andreia.bohner@tappnetwork.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"homepage": "https://github.com/TappNetwork/filament-authentication-log", | ||
"support": { | ||
"issues": "https://github.com/TappNetwork/filament-authentication-log/issues", | ||
"source": "https://github.com/TappNetwork/filament-authentication-log" | ||
}, | ||
"require": { | ||
"php": "^8.1", | ||
"filament/filament": "^3.0-stable", | ||
"rappasoft/laravel-authentication-log": "^3.0", | ||
"spatie/laravel-package-tools": "^1.9" | ||
}, | ||
"require-dev": { | ||
"laravel/pint": "^1.11" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/TappNetwork/filament-authentication-log" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"Tapp\\FilamentAuthenticationLog\\": "src" | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Tapp\\FilamentAuthenticationLog\\FilamentAuthenticationLogServiceProvider" | ||
] | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
'resources' => [ | ||
'AutenticationLogResource' => \Tapp\FilamentAuthenticationLog\Resources\AuthenticationLogResource::class, | ||
], | ||
|
||
'authenticable-resources' => [ | ||
\App\Models\User::class, | ||
], | ||
|
||
'navigation' => [ | ||
'authentication-log' => [ | ||
'sort' => 1, | ||
'icon' => 'heroicon-o-shield-check', | ||
], | ||
], | ||
|
||
'sort' => [ | ||
'column' => 'login_at', | ||
'direction' => 'desc', | ||
], | ||
|
||
]; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
return [ | ||
'navigation.group' => 'Logins', | ||
|
||
'navigation.authentication-log.label' => 'Authentication Log', | ||
'navigation.authentication-log.plural-label' => 'Authentication Logs', | ||
|
||
'table.heading' => 'Authentication Logs', | ||
|
||
'column.authenticatable' => 'Authenticatable', | ||
'column.ip_address' => 'IP Address', | ||
'column.user_agent' => 'User Agent', | ||
'column.login_at' => 'Login At', | ||
'column.login_successful' => 'Login Successful', | ||
'column.logout_at' => 'Logout At', | ||
'column.cleared_by_user' => 'Cleared By User', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Tapp\FilamentAuthenticationLog; | ||
|
||
use Filament\Contracts\Plugin; | ||
use Filament\Panel; | ||
|
||
class FilamentAuthenticationLogPlugin implements Plugin | ||
{ | ||
public static function make(): static | ||
{ | ||
return app(static::class); | ||
} | ||
|
||
public function getId(): string | ||
{ | ||
return 'authentication-log'; | ||
} | ||
|
||
public function register(Panel $panel): void | ||
{ | ||
$panel | ||
->resources( | ||
config('filament-authentication-log.resources') | ||
); | ||
} | ||
|
||
public function boot(Panel $panel): void | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Tapp\FilamentAuthenticationLog; | ||
|
||
use Spatie\LaravelPackageTools\Package; | ||
use Spatie\LaravelPackageTools\PackageServiceProvider; | ||
|
||
class FilamentAuthenticationLogServiceProvider extends PackageServiceProvider | ||
{ | ||
public static string $name = 'filament-authentication-log'; | ||
|
||
public function configurePackage(Package $package): void | ||
{ | ||
$package->name('filament-authentication-log') | ||
->hasConfigFile('filament-authentication-log') | ||
->hasTranslations('filament-authentication-log'); | ||
} | ||
|
||
public function packageBooted(): void | ||
{ | ||
parent::packageBooted(); | ||
|
||
// | ||
} | ||
} |
Oops, something went wrong.