Skip to content

Commit 0c16790

Browse files
committed
feat: init
0 parents  commit 0c16790

10 files changed

+7063
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
/vendor
3+
.php-cs-fixer.cache

.php-cs-fixer.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->notPath('bootstrap')
5+
->notPath('storage')
6+
->notPath('vendor')
7+
->notPath('public')
8+
->notPath('database')
9+
->notPath('tests')
10+
->notPath('Modules')
11+
->in(__DIR__)
12+
->name('*.php')
13+
->name('_ide_helper')
14+
->notName('*.blade.php')
15+
->ignoreDotFiles(true)
16+
->ignoreVCS(true);
17+
18+
return (new PhpCsFixer\Config())
19+
->setRules([
20+
'@PSR2' => true,
21+
'array_syntax' => ['syntax' => 'short'],
22+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
23+
'no_unused_imports' => true,
24+
])
25+
->setFinder($finder);

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 Pham Ngoc Linh
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

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Enable/disable query logger in Laravel
2+
[![StyleCI](https://github.styleci.io/repos/155349271/shield?branch=master)](https://github.styleci.io/repos/155349271)
3+
4+
## Requirements
5+
6+
- PHP >= 7.1.3
7+
- Laravel >= 5.5.*
8+
9+
## Installation
10+
11+
Require this package with composer.
12+
13+
```bash
14+
composer require pnlinh/laravel-query-logger
15+
```
16+
17+
## Usage
18+
19+
To enable log query, set .env file below
20+
```
21+
APP_DEBUG=true
22+
```
23+
24+
To disable log query, set .env file below
25+
```
26+
APP_DEBUG=false
27+
```
28+
29+
## Test
30+
31+
```bash
32+
composer test
33+
```
34+
35+
## Credits
36+
37+
- [Ngoc Linh Pham](https://github.com/pnlinh)

composer.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "pnlinh/laravel-query-logger",
3+
"type": "library",
4+
"description": "Quick enable/disable query logger in Laravel",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Ngoc Linh Pham",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"php": "^7.1.3|^7.3|^8.0"
14+
},
15+
"require-dev": {
16+
"friendsofphp/php-cs-fixer": "*",
17+
"mockery/mockery": "^1.0",
18+
"orchestra/testbench": "^4.0",
19+
"phpunit/phpunit": "^8.0|^9.3.3"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"Pnlinh\\QueryLogger\\": "src/"
24+
}
25+
},
26+
"autoload-dev": {
27+
"psr-4": {
28+
"Pnlinh\\QueryLogger\\Tests\\": "tests/"
29+
}
30+
},
31+
"config": {
32+
"sort-packages": true
33+
},
34+
"extra": {
35+
"laravel": {
36+
"providers": [
37+
"Pnlinh\\QueryLogger\\QueryLoggerServiceProvider"
38+
]
39+
}
40+
},
41+
"scripts": {
42+
"test": [
43+
"vendor/bin/phpunit"
44+
],
45+
"cs": [
46+
"vendor/bin/php-cs-fixer fix"
47+
]
48+
}
49+
}

0 commit comments

Comments
 (0)