socoladaica / laravel-audit
There is no license information available for the latest version (1.3.2) of this package.
This package's canonical repository appears to be gone and the package has been frozen as a result.
1.3.2
2023-02-19 22:54 UTC
Requires
- ext-json: *
- composer/class-map-generator: *
- composer/composer: ^1.6|^2.2
- doctrine/dbal: ^3.5
- friendsofphp/php-cs-fixer: ^v2.19.3|^v3.8.0
- icanhazstring/composer-unused: ^0.8.5
- larswiegers/laravel-translations-checker: ^v0.4
- nunomaduro/larastan: ^2.3
- phpunit/php-code-coverage: *
- phpunit/phpunit: *
- rector/rector: ^0.15.1
- socoladaica/laravel-badassium: *
- spatie/once: ^2.2
- spaze/phpstan-disallowed-calls: ^2.2
Suggests
- barryvdh/laravel-debugbar: PHP Debugbar integration for Laravel
- larswiegers/laravel-translations-checker: Get direct feedback where and what translations you are missing!
- mouadziani/laravel-query-inspector: The missing laravel helper that allows you to ispect your eloquent queries with their binding parameters
- nikic/php-parser: A PHP parser written in PHP
- nunomaduro/phpinsights: Analysis of code quality and coding style
- opcodesio/log-viewer: You will no longer need to read the raw Laravel log files trying to find what you're looking for
- propaganistas/laravel-disposable-email: Disposable email validator
- sarfraznawaz2005/indexer: Laravel Indexer
- spatie/laravel-mail-preview: A mail driver to quickly preview mail
- spatie/laravel-model-info: Using this package you can determine which attributes and relations your model classes have.
- squizlabs/php_codesniffer: PHP_CodeSniffer is a set of two PHP scripts
README
Instalation
composer require socoladaica/laravel-audit
Update phpunit.xml
add testsuite
into testsuites
<testsuite name="Audit"> <directory suffix="Test.php">./vendor/socoladaica/laravel-audit/src/TestCases</directory> </testsuite>
<?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true"> <testsuites> <testsuite name="Audit"> <directory suffix="Test.php">./vendor/socoladaica/laravel-audit/src/TestCases</directory> </testsuite> <testsuite name="Unit"> <directory suffix="Test.php">./tests/Unit</directory> </testsuite> <testsuite name="Feature"> <directory suffix="Test.php">./tests/Feature</directory> </testsuite> </testsuites> <filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">./app</directory> </whitelist> </filter> <php> <server name="APP_ENV" value="testing"/> <server name="BCRYPT_ROUNDS" value="4"/> <server name="CACHE_DRIVER" value="array"/> <server name="DB_CONNECTION" value="sqlite"/> <server name="DB_DATABASE" value=":memory:"/> <server name="MAIL_DRIVER" value="array"/> <server name="QUEUE_CONNECTION" value="sync"/> <server name="SESSION_DRIVER" value="array"/> </php> </phpunit>
vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases"
TestCase
Make sure you run composer dumpautoload before run any testcase
vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\App\\Http\\ControllersTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\App\\Http\\RequestsTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\App\\Models\\ModelTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\App\\Models\\PivotTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\Common\\ClassTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\ConfigsTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\Database\\DatabaseTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\Database\\MigrationsTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\EnvTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\Psr\\Psr1Test" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\Resources\\LangTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\Resources\\SCSSTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\Resources\\ViewsTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\RoutesTest" vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases\\DotFileTest"
Code Fixer
Composer Unused
https://github.com/composer-unused/composer-unused
vendor\bin\composer-unused
Php-cs-fixer
vendor\bin\php-cs-fixer.bat --config=.php_cs.php fix vendor\bin\php-cs-fixer.bat --config=vendor/socoladaica/laravel-audit/.php_cs.php fix vendor\bin\php-cs-fixer.bat --config=vendor/socoladaica/laravel-audit/.php_cs.php fix Modules ..\labs\laravel-audit\vendor\bin\php-cs-fixer.bat --config=..\labs\laravel-audit\.php_cs.php fix ..\labs\laravel-audit\vendor\bin\php-cs-fixer.bat --config=..\labs\laravel-audit\.php_cs.php fix php ..\labs\laravel-audit\fix-phpcs.php
Rector
vendor\bin\rector --config=rector.php process vendor\bin\rector --config=vendor/socoladaica/laravel-audit/rector.php process ..\labs\laravel-audit\vendor\vendor\bin\rector --config=..\labs\laravel-audit\rector.php process ..\labs\laravel-audit\vendor\vendor\bin\rector --config=..\labs\laravel-audit\rector.php process
Phpstan
create phpstan.neon
in root of project
includes: - ./vendor/socoladaica/laravel-audit/audit.neon parameters: paths: - app # The level 9 is the highest level level: 5 ignoreErrors: - '#PHPDoc tag @var#' excludePaths: - ./*/*/FileToBeExcluded.php checkMissingIterableValueType: false
vendor\bin\phpstan analyse
vendor\bin\phpstan analyse -c audit.neon vendor\bin\phpstan analyse -c vendor/socoladaica/laravel-audit/audit.neon Modules
translations-checker
php artisan translations:check
php artisan translations:check --directory=resources/lang
php artisan translations:check --directory=lang
php artisan translations:check --directory=Modules/*/resources/lang
php artisan translations:check --directory=Modules/lang
php artisan cms:audit:lang
blade-formatter
cd vendor\socoladaica\laravel-audit
npm i
cd ../../../
vendor\socoladaica\laravel-audit\node_modules\.bin\blade-formatter resources/**/*.blade.php --w --wrap 999999999999
vendor\socoladaica\laravel-audit\node_modules\.bin\blade-formatter Modules/**/resources/**/*.blade.php --w --wrap 0
vendor\socoladaica\laravel-audit\node_modules\.bin\blade-formatter resources/views/layouts/**/*.blade.php --w --wrap 999999999999
Coming Soon
- Request
- test missing addCustomValues
- date_from addCustomValues today, yesterday
- rule missing type
- attributeShouldNotExists
- instead, rule (between instead min max)
- follow type digits_between
- exists
- missing soft delete
- model not Exists
- duplicate rule
- cast type
- request soft delete
- test missing addCustomValues
- Model
- relation using pivot class instead table string
- column name snake_case
- split big model
- pivot name
- test relation foregin key
- relation should be index
- using pivot instead table string
- mising cast
- Migrattion
- test can roll back
- test migrate match db design
- test foregin key
- Cast
- Controller
- only public resource method
- Routes
- route kebab-case
- dont use closure callback
- use FormRequest instead Request
- controller method not found
- request match controller
- method update should put or patch
- remove route empty action
- resources
- resources/lang
- key snake_case
- resources/assets
- dùng
mix.scripts
thay chomix.copy
- dùng
- resources/views
- use
{{ URL::asset() }}
instead{!! URL::asset() !!}
- use
- database
- column should not null
- column should be unsigned
- column should not negative
- storage:
- chmod
- public
- chmod
- DotFile
- test gitignore
- Other
- remove all todo
- project setup
- vimeo/psalm
- browserlint
- carbon comparerDate
- nên dùng laravel Carbon
- dont use external url
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- add log delete transaction
- document.on insteam element.{event}
- custom 404
- https://codepen.io/knolcoder/pen/ZEewZaY
- https://stackoverflow.com/questions/35774500/how-to-remove-focus-from-a-button-after-botstrap-modal-closed
- https://stackoverflow.com/questions/30322918/bootstrap-modal-restores-button-focus-on-close
- check css support
- tìm hiểu về zerowith character
- https://github.com/shufo/blade-formatter
- Locate request https://github.com/laravel/framework/compare/02fdd82690...503f6e280c
- dont allow delete when child relation exist
- try cath đúng cách
- check format before whereDate
- https://github.com/ash-jc-allen/laravel-config-validator
- https://laravel-news.com/laravel-n1-query-problems
- https://laravel-news.com/disable-eloquent-lazy-loading-during-development
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
- [ ]
Develop
composer.json
{ "requred-dev": { "socoladaica/laravel-audit": "dev-develop" }, "repositories": [ { "type": "path", "url": "../socola-cms-demo-v2/cms-dev/laravel-audit" } ], }
"repositories": [ { "type": "path", "url": "../labs/laravel-audit" } ],
composer require socoladaica/laravel-audit:dev-develop --dev
ALL
vendor\bin\php-cs-fixer.bat --config=vendor/socoladaica/laravel-audit/.php_cs.php fix Modules vendor\bin\phpunit.bat --filter="SocolaDaiCa\\LaravelAudit\\TestCases" vendor\bin\paratest --filter="SocolaDaiCa\\LaravelAudit\\TestCases" vendor\bin\rector --config=vendor/socoladaica/laravel-audit/rector.php process Modules/laravel-audit vendor\bin\phpcs --colors Modules\*