Skip to content

Commit ddcac54

Browse files
authored
Merge pull request #2 from neelkanthk/development
Merging Development into Master
2 parents ded1a68 + a91db06 commit ddcac54

File tree

1,845 files changed

+115352
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,845 files changed

+115352
-4
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor
2+
/composer.lock

README.md

+111-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
# Laravel Surveillance UI
1+
![Laravel Surveillance UI Logo](https://github.com/neelkanthk/repo_logos/blob/master/LaravelSurveillanceUI_small.png?raw=true)
22

3-
Provides UI interface for Laravel Surveillance Package
3+
![](https://img.shields.io/github/v/release/neelkanthk/laravel-surveillance-ui?style=for-the-badge)
4+
![](https://img.shields.io/packagist/php-v/neelkanthk/laravel-surveillance-ui.svg?style=for-the-badge)
5+
![](https://img.shields.io/badge/Laravel-%3E%3D6.0-red?style=for-the-badge)
6+
![](https://img.shields.io/github/stars/neelkanthk/laravel-surveillance-ui?style=for-the-badge)
7+
![](https://img.shields.io/github/issues/neelkanthk/laravel-surveillance-ui?style=for-the-badge)
8+
![](https://img.shields.io/github/license/neelkanthk/laravel-surveillance-ui?style=for-the-badge)
9+
10+
## What is Laravel Surveillance UI?
11+
12+
Provides a Graphical UI for [Laravel Surveillance](https://github.com/neelkanthk/laravel-surveillance) and integrates within your existing application.
13+
14+
## What is Laravel Surveillance?
15+
16+
Laravel Surveillance is a package to put malicious users, IP addresses and anonymous browser fingerprints under surveillance, write surveillance logs and block malicious ones from accessing the app. [Read more](https://github.com/neelkanthk/laravel-surveillance#laravel-surveillance-)
17+
18+
## Laravel Surveillance UI Demo
19+
20+
[![](https://raw.githubusercontent.com/neelkanthk/repo_logos/master/LaravelSurveillanceUi-DemoImg.jpg)](https://www.youtube.com/watch?v=G0foqT7WPeA)
421

522
## Minimum Requirements
623

@@ -10,11 +27,101 @@ Provides UI interface for Laravel Surveillance Package
1027
## Installation
1128

1229
```bash
13-
composer require neelkanthk/laravel-schedulable-ui
30+
composer require neelkanthk/laravel-surveillance-ui
1431
```
1532

1633
## Usage
1734

35+
## Step 1: [Configure Laravel Surveillance](#step-1)
36+
37+
_NOTE:- If you have already installed ```neelkanthk/laravel-surveillance``` in your application then please go directly to Step 2_.
38+
39+
40+
#### 1.1. Publish the migration files:
41+
```bash
42+
php artisan vendor:publish --provider="Neelkanth\Laravel\Surveillance\Providers\SurveillanceServiceProvider" --tag="migrations"
43+
```
44+
45+
#### 1.2. Publish language files:
46+
```bash
47+
php artisan vendor:publish --provider="Neelkanth\Laravel\Surveillance\Providers\SurveillanceServiceProvider" --tag="lang"
48+
```
49+
50+
#### 1.3. Run the migrations
51+
```bash
52+
php artisan migrate
53+
```
54+
55+
#### 1.4. Publish the config file (Optional):
56+
```bash
57+
php artisan vendor:publish --provider="Neelkanth\Laravel\Surveillance\Providers\SurveillanceServiceProvider" --tag="config"
58+
```
59+
60+
[Read more about Laravel Surveillance installation](https://github.com/neelkanthk/laravel-surveillance#installation)
61+
62+
## Step 2: [Configure Laravel Surveillance UI](#step-2)
63+
64+
_The following steps will install Laravel Surveillance UI in your application_.
65+
66+
#### 2.1. Publish views:
67+
```bash
68+
php artisan vendor:publish --provider="Neelkanth\Laravel\SurveillanceUi\Providers\SurveillanceUiServiceProvider" --tag="views"
69+
```
70+
71+
#### 2.2. Publish config:
72+
```bash
73+
php artisan vendor:publish --provider="Neelkanth\Laravel\SurveillanceUi\Providers\SurveillanceUiServiceProvider" --tag="config"
74+
```
75+
76+
#### 2.3. Publish assets:
77+
```bash
78+
php artisan vendor:publish --provider="Neelkanth\Laravel\SurveillanceUi\Providers\SurveillanceUiServiceProvider" --tag="assets"
79+
```
80+
81+
## Add Middleware
82+
83+
Laravel Surveillance provides a ```surveillance``` middleware that can be used on any route or route group to make it eligible for surveillance.
84+
85+
```php
86+
Route::middleware(["surveillance"])->get('/path', function () {});
87+
```
88+
89+
[Read more about middleware usage](https://github.com/neelkanthk/laravel-surveillance#middleware-usage)
90+
91+
## Accessing the Dashboard
92+
93+
The **Laravel Surveillance UI manager dashboard** can be accessed at: http://your.domain/surveillance/ui/manager
94+
95+
The **Laravel Surveillance UI logs dashboard** can be accessed at: http://your.domain/surveillance/ui/logs
96+
97+
## Customizing the package routes
98+
99+
### Customizing the route prefix
100+
101+
By default ```surveillance/ui``` route prefix is appended to the package's routes.
102+
103+
If you want to customize it then you can do so easily in the ```config/surveillance-ui.php``` file's _**prefix**_ key as shown below.
104+
105+
```php
106+
/**
107+
* The prefix to be used in the surveillance ui routes
108+
*/
109+
"prefix" => "surveillance/ui",
110+
```
111+
112+
### Customizing the route middleware
113+
114+
By default ```web``` middleware is added to the package's routes.
115+
116+
If you want to add more middlewares like ```auth``` or something else, then you can add them easily in the ```config/surveillance-ui.php``` file's _**middleware**_ key as shown below.
117+
118+
```php
119+
/**
120+
* The middleware(s) to be used in the surveillance ui routes
121+
*/
122+
"middleware" => ["web", "auth"], //auth middleware added
123+
```
124+
18125
## Contributing
19126
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
20127

@@ -23,7 +130,7 @@ If you discover any security-related issues, please email me.neelkanth@gmail.com
23130

24131
## Credits
25132

26-
- [Neelkanth Kaushik](https://github.com/username)
133+
- [Neelkanth Kaushik](https://github.com/neelkanthk)
27134
- [All Contributors](../../contributors)
28135

29136
## License

composer.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "neelkanthk/laravel-surveillance-ui",
3+
"description": "Laravel Surveillance GUI provides a web based interface for Laravel Surveillance package.",
4+
"type": "laravel-package",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "neelkanth.kaushik",
9+
"email": "me.neelkanth@gmail.com"
10+
}
11+
],
12+
"minimum-stability": "dev",
13+
"require": {
14+
"php": ">=7.2",
15+
"laravel/framework": ">=6.0",
16+
"neelkanthk/laravel-surveillance": "^1.3"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"Neelkanth\\Laravel\\SurveillanceUi\\": "src"
21+
}
22+
},
23+
"require-dev": {
24+
"phpunit/phpunit": "^9.0",
25+
"orchestra/testbench": "^6.0|^7.0",
26+
"doctrine/dbal": "^4.0@dev"
27+
},
28+
"autoload-dev": {
29+
"psr-4": {
30+
"Neelkanth\\Laravel\\SurveillanceUi\\Tests\\": "tests"
31+
}
32+
},
33+
"extra": {
34+
"laravel": {
35+
"providers": [
36+
"Neelkanth\\Laravel\\SurveillanceUi\\Providers\\SurveillanceUiServiceProvider"
37+
]
38+
}
39+
},
40+
"scripts": {
41+
"test": "vendor\\bin\\phpunit --testdox"
42+
}
43+
}

config/surveillance-ui.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
return [
4+
/**
5+
* The prefix to be used in the surveillance ui routes
6+
7+
*/
8+
"prefix" => "surveillance/ui",
9+
10+
/**
11+
* The middleware(s) to be used in the surveillance ui routes
12+
*/
13+
"middleware" => ["web"],
14+
15+
/**
16+
* App name
17+
*/
18+
"app_name" => 'Laravel Surveillance<sup>UI</sup>',
19+
20+
/**
21+
* Sidebar color bootstrap class
22+
*/
23+
"sidebar_color" => 'primary',
24+
25+
/**
26+
* Github repo URL
27+
*/
28+
"github" => 'https://github.com/neelkanthk/laravel-surveillance'
29+
];

phpunit.xml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Laravel Surveillance GUI Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
</phpunit>

resources/assets/css/app.css

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#manager_listing
2+
{
3+
color: #000;
4+
}
5+
6+
.checkbox{background-color:#fff;display:inline-block;height:28px;margin:0 .25em;width:28px;border-radius:4px;border:1px solid #ccc;float:right}
7+
.checkbox span{display:block;height:28px;position:relative;width:28px;padding:0}
8+
.checkbox span:after{-moz-transform:scaleX(-1) rotate(135deg);-ms-transform:scaleX(-1) rotate(135deg);-webkit-transform:scaleX(-1) rotate(135deg);transform:scaleX(-1) rotate(135deg);-moz-transform-origin:left top;-ms-transform-origin:left top;-webkit-transform-origin:left top;transform-origin:left top;border-right:4px solid #fff;border-top:4px solid #fff;content:'';display:block;height:20px;left:3px;position:absolute;top:15px;width:10px}
9+
/* .checkbox span:hover:after{border-color:#999} */
10+
.checkbox input{display:none}
11+
.checkbox input:checked + span:after{-webkit-animation:check .8s;-moz-animation:check .8s;-o-animation:check .8s;animation:check .8s;border-color:#555}
12+
.checkbox input:checked + .default:after{border-color:#444}
13+
.checkbox input:checked + .primary:after{border-color:#2196F3}
14+
.checkbox input:checked + .success:after{border-color:#8bc34a}
15+
.checkbox input:checked + .info:after{border-color:#3de0f5}
16+
.checkbox input:checked + .warning:after{border-color:#FFC107}
17+
.checkbox input:checked + .danger:after{border-color:#f44336}

resources/assets/css/app.min.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/assets/css/datatable/dataTables.bootstrap4.min.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)