Skip to content

Commit bfac4ab

Browse files
committed
init commit
0 parents  commit bfac4ab

33 files changed

+12438
-0
lines changed

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/.phpunit.cache
2+
/node_modules
3+
/public/build
4+
/public/hot
5+
/public/storage
6+
/storage/*.key
7+
/vendor
8+
.phpunit.result.cache
9+
Homestead.json
10+
Homestead.yaml
11+
auth.json
12+
npm-debug.log
13+
yarn-error.log
14+
/.fleet
15+
/.idea
16+
/.vscode
17+
/packages

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) dotswan <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Filament laravel pulse
2+
3+
[![Latest Version on Packagist][ico-version]][link-packagist]
4+
[![Total Downloads][ico-downloads]][link-downloads]
5+
[![Software License][ico-license]][link-license]
6+
7+
8+
9+
## Introduction
10+
11+
Filament Laravel Pulse is a package designed to enhance your Filament dashboard with comprehensive monitoring widgets. It provides insights into various aspects of your Laravel application's performance, including cache usage, exceptions, queues, servers, and more. By integrating these widgets into your Filament dashboard, you gain visibility into critical metrics and streamline your monitoring process.
12+
13+
14+
## Features
15+
16+
Filament Laravel Pulse offers the following features:
17+
18+
- Server Monitoring: Track server performance metrics.
19+
- Cache Usage: Monitor cache utilization and performance.
20+
- Exception Tracking: View and manage exceptions thrown by your application.
21+
- Queue Management: Monitor job queues and processing times.
22+
- Performance Analytics: Insights into slow outgoing requests, queries, and application usage patterns.
23+
24+
## Installation
25+
26+
To integrate the Filament Laravel Pulse package into your project, use Composer:
27+
28+
```bash
29+
composer require dotswan/filament-laravel-pulse
30+
```
31+
32+
Filament Laravel Pulse can be configured to suit your application's specific needs.
33+
After installing the package, publish the configuration file using Artisan:
34+
35+
```bash
36+
php artisan vendor:publish --provider="Dotswan\FilamentLaravelPulse\FilamentLaravelPulseServiceProvider"
37+
```
38+
39+
## Basic Usage
40+
41+
To start using Filament Laravel Pulse, follow these steps:
42+
43+
1. **Create a Custom Filament Page:** Extend the default Filament dashboard by creating a custom page. You can define your custom dashboard class and extend `app/Filament\Pages\Dashboard`.
44+
45+
2. **Define Widgets:** Inside your custom dashboard class, define which widgets to include. Use the provided Pulse widgets (PulseCache, PulseExceptions, etc.) to display relevant metrics.
46+
47+
```php
48+
49+
<?php
50+
51+
use Dotswan\FilamentLaravelPulse\Widgets\PulseCache;
52+
use Dotswan\FilamentLaravelPulse\Widgets\PulseExceptions;
53+
use Dotswan\FilamentLaravelPulse\Widgets\PulseQueues;
54+
use Dotswan\FilamentLaravelPulse\Widgets\PulseServers;
55+
use Dotswan\FilamentLaravelPulse\Widgets\PulseSlowOutGoingRequests;
56+
use Dotswan\FilamentLaravelPulse\Widgets\PulseSlowQueries;
57+
use Dotswan\FilamentLaravelPulse\Widgets\PulseSlowRequests;
58+
use Dotswan\FilamentLaravelPulse\Widgets\PulseUsage;
59+
use Filament\Actions\Action;
60+
use Filament\Actions\ActionGroup;
61+
use Filament\Pages\Dashboard\Concerns\HasFiltersAction;
62+
use Filament\Support\Enums\ActionSize;
63+
64+
class Dashboard extends \Filament\Pages\Dashboard
65+
{
66+
use HasFiltersAction;
67+
68+
public function getColumns(): int|string|array
69+
{
70+
return 12;
71+
}
72+
73+
protected function getHeaderActions(): array
74+
{
75+
return [
76+
ActionGroup::make([
77+
Action::make('1h')
78+
->action(fn() => $this->redirect(route('filament.manager.pages.dashboard'))),
79+
Action::make('24h')
80+
->action(fn() => $this->redirect(route('filament.manager.pages.dashboard', ['period' => '24_hours']))),
81+
Action::make('7d')
82+
->action(fn() => $this->redirect(route('filament.manager.pages.dashboard', ['period' => '7_days']))),
83+
])
84+
->label(__('Filter'))
85+
->icon('heroicon-m-funnel')
86+
->size(ActionSize::Small)
87+
->color('gray')
88+
->button()
89+
];
90+
}
91+
92+
public function getWidgets(): array
93+
{
94+
return [
95+
PulseServers::class,
96+
PulseCache::class,
97+
PulseExceptions::class,
98+
PulseUsage::class,
99+
PulseQueues::class,
100+
PulseSlowQueries::class,
101+
PulseSlowRequests::class,
102+
PulseSlowOutGoingRequests::class
103+
];
104+
}
105+
}
106+
```
107+
108+
Example Configuration
109+
110+
Here's an example of what you might find in the published filament-laravel-pulse.php configuration file:
111+
112+
```php
113+
<?php
114+
115+
return [
116+
'components' => [
117+
// Customize and configure your monitoring widgets here
118+
'cache' => [
119+
'columnSpan' => [
120+
'md' => 5,
121+
'xl' => 5,
122+
],
123+
'cols' => 'full',
124+
'ignoreAfter' => '1 hour',
125+
'isDiscovered' => true,
126+
'isLazy' => true,
127+
'sort' => null,
128+
'canView' => true,
129+
'columnStart' => [],
130+
],
131+
// Define more components as needed
132+
],
133+
];
134+
135+
```
136+
Modify the array under 'components' to adjust settings for each monitoring widget provided by Filament Laravel Pulse.
137+
138+
## License
139+
140+
This package is distributed under the [MIT License](link-to-your-license).
141+
142+
## Security
143+
144+
Security is a priority for us. If you encounter any security-related issues or vulnerabilities, please report them via our [GitHub issue tracker][link-github-issue]. For direct communication, reach out to [[email protected]](mailto:[email protected]).
145+
146+
## Contribution
147+
148+
Contributions are welcome and valued. Enhancements, suggestions, and bug reports help improve this package for everyone. Here's how you can contribute:
149+
150+
1. Fork the Project
151+
2. Create a Feature Branch (`git checkout -b feature/AmazingFeature`)
152+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
153+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
154+
5. Open a Pull Request
155+
156+
Thank you for considering contributing to the Filament Laravel Pulse!
157+
158+
[ico-version]: https://img.shields.io/packagist/v/dotswan/filament-laravel-pulse.svg?style=flat-square
159+
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
160+
[ico-downloads]: https://img.shields.io/packagist/dt/dotswan/filament-laravel-pulse.svg?style=flat-square
161+
162+
[link-packagist]: https://packagist.org/packages/dotswan/filament-laravel-pulse
163+
[link-license]: https://github.com/dotswan/filament-laravel-pulse/blob/master/LICENSE.md
164+
[link-downloads]: https://packagist.org/packages/dotswan/filament-laravel-pulse
165+
[link-github-issue]: https://github.com/dotswan/filament-laravel-pulse/issues

composer.json

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "dotswan/filament-laravel-pulse",
3+
"description": "",
4+
"keywords": [
5+
"dotswan",
6+
"laravel",
7+
"laravel-pulse",
8+
"filament-laravel-pulse"
9+
],
10+
"homepage": "https://github.com/dotswan/filament-laravel-pulse",
11+
"support": {
12+
"issues": "https://github.com/dotswan/filament-laravel-pulse/issues",
13+
"source": "https://github.com/dotswan/filament-laravel-pulse"
14+
},
15+
"license": "MIT",
16+
"authors": [
17+
{
18+
"name": "Dotswan",
19+
"email": "[email protected]",
20+
"role": "Developer"
21+
}
22+
],
23+
"require": {
24+
"php": "^8.2",
25+
"filament/filament": "^3.0",
26+
"spatie/laravel-package-tools": "^1.15.0",
27+
"illuminate/contracts": "^10.0 || ^11.0",
28+
"laravel/pulse": "^1.2.3"
29+
},
30+
"require-dev": {
31+
"laravel/pint": "^1.0",
32+
"nunomaduro/collision": "^7.9",
33+
"nunomaduro/larastan": "^2.0.1",
34+
"orchestra/testbench": "^8.0",
35+
"pestphp/pest": "^2.0",
36+
"pestphp/pest-plugin-arch": "^2.0",
37+
"pestphp/pest-plugin-laravel": "^2.0",
38+
"phpstan/extension-installer": "^1.1",
39+
"phpstan/phpstan-deprecation-rules": "^1.0",
40+
"phpstan/phpstan-phpunit": "^1.0"
41+
},
42+
"autoload": {
43+
"psr-4": {
44+
"Dotswan\\FilamentLaravelPulse\\": "src/"
45+
}
46+
},
47+
"autoload-dev": {
48+
"psr-4": {
49+
"Dotswan\\FilamentLaravelPulse\\Tests\\": "tests/"
50+
}
51+
},
52+
"scripts": {
53+
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi",
54+
"analyse": "vendor/bin/phpstan analyse",
55+
"test": "vendor/bin/pest",
56+
"test-coverage": "vendor/bin/pest --coverage",
57+
"format": "vendor/bin/pint"
58+
},
59+
"config": {
60+
"sort-packages": true,
61+
"allow-plugins": {
62+
"pestphp/pest-plugin": true,
63+
"phpstan/extension-installer": true
64+
}
65+
},
66+
"extra": {
67+
"laravel": {
68+
"providers": [
69+
"Dotswan\\FilamentLaravelPulse\\FilamentLaravelPulseServiceProvider"
70+
],
71+
"aliases": {
72+
"FilamentLaravelPulse": "Dotswan\\FilamentLaravelPulse\\Facades\\FilamentLaravelPulse"
73+
}
74+
}
75+
},
76+
"minimum-stability": "dev",
77+
"prefer-stable": true
78+
}

0 commit comments

Comments
 (0)