Skip to content

Commit b88b9d7

Browse files
authored
Merge pull request #4 from binafy/patch-1
[0.x] Add Documentation into README
2 parents 433e533 + 2a43297 commit b88b9d7

File tree

1 file changed

+187
-0
lines changed

1 file changed

+187
-0
lines changed

README.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,188 @@
11
## Laravel User Monitoring
2+
3+
<img src="https://banners.beyondco.de/Laravel%20User%20Monitoring.png?theme=dark&packageManager=composer+require&packageName=binafy%2Flaravel-user-monitoring&pattern=volcanoLamp&style=style_1&description=Monitor+your+user+and+all+activity+on+your+application&md=1&showWatermark=0&fontSize=100px&images=https%3A%2F%2Flaravel.com%2Fimg%2Flogomark.min.svg" alt="laravel-user-monitoring-banner">
4+
5+
[![PHP Version Require](http://poser.pugx.org/binafy/laravel-user-monitoring/require/php)](https://packagist.org/packages/binafy/laravel-user-monitoring)
6+
[![Latest Stable Version](http://poser.pugx.org/binafy/laravel-user-monitoring/v)](https://packagist.org/packages/binafy/laravel-user-monitoring)
7+
[![Total Downloads](http://poser.pugx.org/binafy/laravel-user-monitoring/downloads)](https://packagist.org/packages/binafy/laravel-user-monitoring)
8+
[![License](http://poser.pugx.org/binafy/laravel-user-monitoring/license)](https://packagist.org/packages/binafy/laravel-user-monitoring)
9+
[![Passed Tests](https://github.com/binafy/laravel-user-monitoring/actions/workflows/tests.yml/badge.svg)](https://github.com/binafy/laravel-user-monitoring/actions/workflows/tests.yml)
10+
11+
- [Introduction](#introduction)
12+
- [Installation](#installation)
13+
- Usage
14+
- [Visit Monitoring](#visit-monitoring)
15+
- [Action Monitoring](#action-monitoring)
16+
- [Authentication Monitoring](#authentication-monitoring)
17+
- [Contributors](#contributors)
18+
- [Security](#security)
19+
- [Changelog](#changelog)
20+
- [License](#license)
21+
- [Conclusion](#conclusion)
22+
23+
<a name="introduction"></a>
24+
## Introduction
25+
26+
Welcome to the world of enhanced user monitoring with the groundbreaking `Laravel User Monitoring` package! Developed by the brilliant minds at `Binafy`, this innovative open-source solution is designed to empower Laravel developers and website administrators with invaluable insights into user activities.
27+
28+
Tracking user behavior and interactions is now made effortless, allowing you to gain a deeper understanding of your users' engagement, preferences, and pain points. With its seamless integration into Laravel projects, this package opens up a realm of possibilities, enabling you to optimize user experiences, detect bottlenecks, and make data-driven decisions for your platform's success.
29+
30+
Experience real-time monitoring like never before, as you access comprehensive analytics and visualize user interactions with ease. Rest assured, your users' data is handled securely, respecting privacy while giving you the tools to improve your application's performance and user satisfaction.
31+
32+
Whether you are building a new project or looking to enhance an existing one, "Laravel User Monitoring" is the missing piece to elevate your web applications to new heights. So, why wait? Dive into the world of intelligent user monitoring and witness the transformation of your Laravel-powered application today!
33+
34+
<a name="installation"></a>
35+
## Installation
36+
37+
You can install the package with Composer.
38+
39+
```bash
40+
composer require binafy/laravel-user-monitoring
41+
```
42+
43+
## Publish
44+
45+
If you want to publish a config file you can use this command:
46+
47+
```shell
48+
php artisan vendor:publish --tag="laravel-user-monitoring-config"
49+
```
50+
51+
If you want to publish a migration files you can use this command:
52+
53+
```shell
54+
php artisan vendor:publish --tag="laravel-user-monitoring-migrations"
55+
```
56+
57+
For convience, you can use this command to publish config and migration files:
58+
59+
```shell
60+
php artisan vendor:publish --provider="Binafy\LaravelUserMonitoring\Providers\LaravelUserMonitoringServiceProvider"
61+
```
62+
63+
After publishing, run `php artisan migrate` command.
64+
65+
<a name="visit-monitoring"></a>
66+
## Visit Monitoring
67+
68+
When you want to monitor all views of your application, you must follow below:
69+
70+
1. Publish the [Migrations](#publish)
71+
72+
2. Use `VisitMonitoringMiddleware` in Kernel.php, you can go to `App/Http` folder and open the `Kernel.php` file and add `VisitMonitoringMiddleware` into your middleware for example:
73+
```php
74+
protected $middlewareGroups = [
75+
'web' => [
76+
...
77+
\Binafy\LaravelUserMonitoring\Middlewares\VisitMonitoringMiddleware::class,
78+
],
79+
80+
'api' => [
81+
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
82+
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
83+
\Illuminate\Routing\Middleware\SubstituteBindings::class,
84+
],
85+
];
86+
```
87+
88+
After, you can see all pages monitoring :)
89+
90+
If you want to disable monitoring for specific pages you can go to `user-monitoring.php` that exists in `config` folder and add pages into `visit_monitoring` key:
91+
92+
```php
93+
'visit_monitoring' => [
94+
/*
95+
* You can specify pages not to be monitored.
96+
*/
97+
'expect_pages' => [
98+
'home',
99+
'admin/dashboard',
100+
],
101+
],
102+
```
103+
104+
<a name="action-monitoring"></a>
105+
## Action Monitoring
106+
107+
If you want to monitor your models actions, you can use `Actionable` trait into your model:
108+
109+
```php
110+
<?php
111+
112+
namespace App\Models;
113+
114+
use Binafy\LaravelUserMonitoring\Traits\Actionable;
115+
use Illuminate\Database\Eloquent\Model;
116+
117+
class Product extends Model
118+
{
119+
use Actionable;
120+
}
121+
```
122+
123+
Now when a product readed, created, updated or deleted, you can see which users doing that.
124+
125+
If you want to disable some action like created, you can use config file:
126+
127+
```php
128+
'action_monitoring' => [
129+
...
130+
131+
/*
132+
* Monitor actions.
133+
*
134+
* You can set true/false for monitor actions like (store, update, and ...).
135+
*/
136+
'on_store' => false,
137+
'on_update' => true,
138+
'on_destroy' => true,
139+
'on_read' => true,
140+
'on_restore' => false,
141+
'on_replicate' => false,
142+
],
143+
```
144+
145+
<a name="authentication-monitoring"></a>
146+
## Authentication Monitoring
147+
148+
Have you ever thought about monitoring the entry and exit of users of your application? Now you can :) <br>
149+
If you want to monitor users when login or logout in your application, you need migrate the migrations and go to config file and change true for monitoring authentication.
150+
151+
```php
152+
'authentication_monitoring' => [
153+
...
154+
155+
/*
156+
* You can set true/false for monitor login or logout.
157+
*/
158+
'on_login' => true,
159+
'on_logout' => true,
160+
],
161+
```
162+
163+
<a name="contributors"></a>
164+
## Contributors
165+
166+
Thanks to all the people who contribute. [Contributors](https://github.com/binafy/laravel-user-monitoring/graphs/contributors).
167+
168+
<a href="https://github.com/binafy/laravel-user-monitoring/graphs/contributors"><img src="https://opencollective.com/laravel-user-monitoring/contributors.svg?width=890&button=false" /></a>
169+
170+
<a name="security"></a>
171+
## Security
172+
173+
If you discover any security-related issues, please email `[email protected]` instead of using the issue tracker.
174+
175+
<a name="chanelog"></a>
176+
## Changelog
177+
178+
The changelog can be found in the `CHANGELOG.md` file of the GitHub repository. It lists the changes, bug fixes, and improvements made to each version of the Laravel User Monitoring package.
179+
180+
<a name="license"></a>
181+
## License
182+
183+
The MIT License (MIT). Please see [License File](https://github.com/binafy/laravel-user-monitoring/blob/0.x-dev/LICENSE) for more information.
184+
185+
<a name="conclusion"></a>
186+
## Conclusion
187+
188+
Congratulations! You have successfully installed and integrated the Laravel User Monitoring package into your Laravel application. By effectively logging and analyzing user activity, you can gain valuable insights that can help you improve your application's user experience and performance. If you have any questions or need further assistance, feel free to refer to the documentation or seek help from the package's GitHub repository. Happy monitoring!

0 commit comments

Comments
 (0)