diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 134caa7..8c2df1a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,5 @@ version: 2 + updates: - package-ecosystem: composer directory: "/" @@ -9,6 +10,7 @@ updates: prefix: "#5 - (php) " target-branch: main open-pull-requests-limit: 1 + - package-ecosystem: npm directory: "/" schedule: diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index e1d6495..5164142 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -12,5 +12,6 @@ jobs: check-pr-title: name: Check PR title runs-on: ubuntu-20.04 + steps: - uses: blumilksoftware/action-pr-title@v1.2.0 diff --git a/.github/workflows/test-and-lint-js.yml b/.github/workflows/test-and-lint-js.yml index c4b36dd..ad97c1a 100644 --- a/.github/workflows/test-and-lint-js.yml +++ b/.github/workflows/test-and-lint-js.yml @@ -6,6 +6,7 @@ on: jobs: test-and-lint-js: + name: Test & lint JS stuff runs-on: ubuntu-20.04 steps: diff --git a/.github/workflows/test-and-lint-php.yml b/.github/workflows/test-and-lint-php.yml index a4f2437..430fdf6 100644 --- a/.github/workflows/test-and-lint-php.yml +++ b/.github/workflows/test-and-lint-php.yml @@ -8,6 +8,7 @@ on: jobs: test-and-lint-php: + name: Test & lint PHP stuff runs-on: ubuntu-20.04 steps: diff --git a/app/Models/User.php b/app/Models/User.php index 7f6a7f2..880eb84 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -7,11 +7,9 @@ namespace Toby\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; -use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { - use HasApiTokens; use HasFactory; use Notifiable; diff --git a/bootstrap/app.php b/bootstrap/app.php index 423bf59..ed6258d 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -2,23 +2,19 @@ declare(strict_types=1); -$app = new Illuminate\Foundation\Application( - $_ENV["APP_BASE_PATH"] ?? dirname(__DIR__), -); +use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract; +use Illuminate\Contracts\Debug\ExceptionHandler as HandlerContract; +use Illuminate\Contracts\Http\Kernel as HttpKernelContract; +use Illuminate\Foundation\Application; +use Toby\Console\Kernel as ConsoleKernel; +use Toby\Exceptions\Handler; +use Toby\Http\Kernel as HttpKernel; -$app->singleton( - Illuminate\Contracts\Http\Kernel::class, - Toby\Http\Kernel::class, -); +$basePath = $_ENV["APP_BASE_PATH"] ?? dirname(__DIR__); +$application = new Application($basePath); -$app->singleton( - Illuminate\Contracts\Console\Kernel::class, - Toby\Console\Kernel::class, -); +$application->singleton(HttpKernelContract::class, HttpKernel::class); +$application->singleton(ConsoleKernelContract::class, ConsoleKernel::class); +$application->singleton(HandlerContract::class, Handler::class); -$app->singleton( - Illuminate\Contracts\Debug\ExceptionHandler::class, - Toby\Exceptions\Handler::class, -); - -return $app; +return $application; diff --git a/composer.json b/composer.json index 6adfcac..fcf7c40 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ }, "require-dev": { "blumilksoftware/codestyle": "^0.9.0", + "enlightn/enlightn": "^1.22", "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 7c1defc..7d273d9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f17ac43c54d4ab19c3dfa87a3b6360c4", + "content-hash": "1f888e8a9e8764750ed43fbb8697721e", "packages": [ { "name": "asm89/stack-cors", @@ -5505,6 +5505,548 @@ }, "time": "2022-01-04T07:21:36+00:00" }, + { + "name": "composer/ca-bundle", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.3.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-10-28T20:44:15+00:00" + }, + { + "name": "composer/composer", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "8a5ad75194f901e3b39ece4bbd22cbdabc79ae8f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/8a5ad75194f901e3b39ece4bbd22cbdabc79ae8f", + "reference": "8a5ad75194f901e3b39ece4bbd22cbdabc79ae8f", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/metadata-minifier": "^1.0", + "composer/pcre": "^1.0", + "composer/semver": "^3.0", + "composer/spdx-licenses": "^1.2", + "composer/xdebug-handler": "^2.0", + "justinrainbow/json-schema": "^5.2.11", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0 || ^2.0", + "react/promise": "^1.2 || ^2.7", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" + }, + "require-dev": { + "phpspec/prophecy": "^1.10", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "https://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/composer/issues", + "source": "https://github.com/composer/composer/tree/2.2.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-08T11:30:42+00:00" + }, + { + "name": "composer/metadata-minifier", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/metadata-minifier.git", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2", + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\MetadataMinifier\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Small utility library that handles metadata minification and expansion.", + "keywords": [ + "composer", + "compression" + ], + "support": { + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-04-07T13:37:33+00:00" + }, + { + "name": "composer/pcre", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-12-06T15:17:27+00:00" + }, + { + "name": "composer/semver", + "version": "3.2.7", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.7" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-04T09:57:54+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "a30d487169d799745ca7280bc90fdfa693536901" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a30d487169d799745ca7280bc90fdfa693536901", + "reference": "a30d487169d799745ca7280bc90fdfa693536901", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.6" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-11-18T10:14:14+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "shasum": "" + }, + "require": { + "composer/pcre": "^1", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-04T17:06:45+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.0", @@ -5574,6 +6116,159 @@ ], "time": "2020-11-10T18:47:58+00:00" }, + { + "name": "enlightn/enlightn", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/enlightn/enlightn.git", + "reference": "b4743d1abbcaf8340729a9cada2cceced33ff2c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/enlightn/enlightn/zipball/b4743d1abbcaf8340729a9cada2cceced33ff2c6", + "reference": "b4743d1abbcaf8340729a9cada2cceced33ff2c6", + "shasum": "" + }, + "require": { + "enlightn/security-checker": "^1.1", + "ext-json": "*", + "guzzlehttp/guzzle": "^5.0|^6.0|^7.0", + "laravel/framework": "^6.0|^7.0|^8.0", + "nikic/php-parser": "^4.0", + "nunomaduro/larastan": "^0.6.11|^0.7", + "php": "^7.2|^8.0", + "phpstan/phpstan": "^0.12.59", + "symfony/finder": "^4.0|^5.0" + }, + "require-dev": { + "barryvdh/laravel-ide-helper": "^2.8", + "brianium/paratest": "^6.1", + "fideloper/proxy": "^4.4", + "friendsofphp/php-cs-fixer": "^2.18", + "mockery/mockery": "^1.3", + "orchestra/testbench": "^4.0|^5.0|^6.0", + "phpunit/phpunit": "^7.5|^8.0|^9.0", + "predis/predis": "*" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Enlightn\\Enlightn\\EnlightnServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Enlightn\\Enlightn\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Paras Malhotra", + "email": "paras@laravel-enlightn.com" + }, + { + "name": "Miguel Piedrafita", + "email": "soy@miguelpiedrafita.com" + }, + { + "name": "Lars Klopstra", + "email": "lars@flowframe.nl" + } + ], + "description": "Enlightn - Your performance & security consultant, an artisan command away.", + "homepage": "https://www.laravel-enlightn.com/", + "keywords": [ + "Audit", + "analysis tool", + "dynamic analysis", + "dynamic analyzer", + "laravel", + "package", + "performance", + "security", + "static analysis", + "static analyzer" + ], + "support": { + "docs": "https://www.laravel-enlightn.com/docs/", + "issues": "https://github.com/enlightn/enlightn/issues", + "source": "https://github.com/enlightn/enlightn/tree/v1.22.1" + }, + "time": "2021-05-03T07:32:51+00:00" + }, + { + "name": "enlightn/security-checker", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/enlightn/security-checker.git", + "reference": "dc5bce653fa4d9c792e9dcffa728c0642847c1e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/enlightn/security-checker/zipball/dc5bce653fa4d9c792e9dcffa728c0642847c1e1", + "reference": "dc5bce653fa4d9c792e9dcffa728c0642847c1e1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "^6.3|^7.0", + "php": ">=5.6", + "symfony/console": "^3.4|^4|^5", + "symfony/finder": "^3|^4|^5", + "symfony/process": "^3.4|^4|^5", + "symfony/yaml": "^3.4|^4|^5" + }, + "require-dev": { + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^2.18", + "phpunit/phpunit": "^5.5|^6|^7|^8|^9" + }, + "bin": [ + "security-checker" + ], + "type": "library", + "autoload": { + "psr-4": { + "Enlightn\\SecurityChecker\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paras Malhotra", + "email": "paras@laravel-enlightn.com" + }, + { + "name": "Miguel Piedrafita", + "email": "soy@miguelpiedrafita.com" + } + ], + "description": "A PHP dependency vulnerabilities scanner based on the Security Advisories Database.", + "keywords": [ + "package", + "php", + "scanner", + "security", + "security advisories", + "vulnerability scanner" + ], + "support": { + "issues": "https://github.com/enlightn/security-checker/issues", + "source": "https://github.com/enlightn/security-checker/tree/v1.9.0" + }, + "time": "2021-05-06T09:03:35+00:00" + }, { "name": "facade/flare-client-php", "version": "1.9.1", @@ -5957,6 +6652,76 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.11", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" + }, + "time": "2021-07-22T09:24:00+00:00" + }, { "name": "mockery/mockery", "version": "1.4.4", @@ -6174,6 +6939,104 @@ ], "time": "2021-09-20T15:06:32+00:00" }, + { + "name": "nunomaduro/larastan", + "version": "v0.7.15", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/larastan.git", + "reference": "fffd371277aeca7951a841818d21f1015a0a2662" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/fffd371277aeca7951a841818d21f1015a0a2662", + "reference": "fffd371277aeca7951a841818d21f1015a0a2662", + "shasum": "" + }, + "require": { + "composer/composer": "^1.0 || ^2.0", + "ext-json": "*", + "illuminate/console": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/container": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/contracts": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/http": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/pipeline": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "mockery/mockery": "^0.9 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^0.12.90", + "symfony/process": "^4.3 || ^5.0 || ^6.0" + }, + "require-dev": { + "nikic/php-parser": "4.12.0", + "orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0", + "phpunit/phpunit": "^7.3 || ^8.2 || ^9.3" + }, + "suggest": { + "orchestra/testbench": "Using Larastan for analysing a package needs Testbench" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "0.7-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\Larastan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "larastan", + "laravel", + "package", + "php", + "static analysis" + ], + "support": { + "issues": "https://github.com/nunomaduro/larastan/issues", + "source": "https://github.com/nunomaduro/larastan/tree/v0.7.15" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/canvural", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2021-10-26T11:07:56+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -6512,6 +7375,70 @@ }, "time": "2021-12-08T12:19:24+00:00" }, + { + "name": "phpstan/phpstan", + "version": "0.12.99", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7", + "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/0.12.99" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2021-09-12T20:09:55+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.10", @@ -6933,6 +7860,56 @@ ], "time": "2021-12-25T07:07:57+00:00" }, + { + "name": "react/promise", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.8.0" + }, + "time": "2020-05-12T15:16:56+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -7897,6 +8874,255 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "seld/jsonlint", + "version": "1.8.3", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2020-11-11T09:19:24+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "9f3452c93ff423469c0d56450431562ca423dcee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/9f3452c93ff423469c0d56450431562ca423dcee", + "reference": "9f3452c93ff423469c0d56450431562ca423dcee", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phar" + ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.0" + }, + "time": "2021-12-10T11:20:11+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v6.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "52b3c9cce673b014915445a432339f282e002ce6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/52b3c9cce673b014915445a432339f282e002ce6", + "reference": "52b3c9cce673b014915445a432339f282e002ce6", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-29T07:35:21+00:00" + }, + { + "name": "symfony/yaml", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "b9eb163846a61bb32dfc147f7859e274fab38b58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/b9eb163846a61bb32dfc147f7859e274fab38b58", + "reference": "b9eb163846a61bb32dfc147f7859e274fab38b58", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.3" + }, + "require-dev": { + "symfony/console": "^5.3|^6.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-16T21:58:21+00:00" + }, { "name": "symplify/easy-coding-standard", "version": "10.0.8", diff --git a/config/auth.php b/config/auth.php index 9edda38..a77b4f2 100644 --- a/config/auth.php +++ b/config/auth.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use Toby\Models\User; + return [ "defaults" => [ "guard" => "web", @@ -16,7 +18,7 @@ return [ "providers" => [ "users" => [ "driver" => "eloquent", - "model" => Toby\Models\User::class, + "model" => User::class, ], ], "passwords" => [ diff --git a/config/enlightn.php b/config/enlightn.php new file mode 100644 index 0000000..8b0e9ca --- /dev/null +++ b/config/enlightn.php @@ -0,0 +1,68 @@ + ["*"], + "exclude_analyzers" => [], + "ci_mode_exclude_analyzers" => [], + "analyzer_paths" => [ + "Enlightn\\Enlightn\\Analyzers" => base_path("vendor/enlightn/enlightn/src/Analyzers"), + "Enlightn\\EnlightnPro\\Analyzers" => base_path("vendor/enlightn/enlightnpro/src/Analyzers"), + ], + "base_path" => [ + app_path(), + database_path("migrations"), + database_path("seeders"), + ], + "skip_env_specific" => env("ENLIGHTN_SKIP_ENVIRONMENT_SPECIFIC", false), + "guest_url" => null, + "dont_report" => [], + "ignore_errors" => [], + "license_whitelist" => [ + "Apache-2.0", + "Apache2", + "BSD-2-Clause", + "BSD-3-Clause", + "LGPL-2.1-only", + "LGPL-2.1", + "LGPL-2.1-or-later", + "LGPL-3.0", + "LGPL-3.0-only", + "LGPL-3.0-or-later", + "MIT", + "ISC", + "CC0-1.0", + "Unlicense", + "WTFPL", + ], + "credentials" => [ + "username" => env("ENLIGHTN_USERNAME"), + "api_token" => env("ENLIGHTN_API_TOKEN"), + ], + "github_repo" => env("ENLIGHTN_GITHUB_REPO"), + "compact_lines" => true, + "commercial_packages" => [ + "enlightn/enlightnpro", + ], + "allowed_permissions" => [ + base_path() => "775", + app_path() => "775", + resource_path() => "775", + storage_path() => "775", + public_path() => "775", + config_path() => "775", + database_path() => "775", + base_path("routes") => "775", + app()->bootstrapPath() => "775", + app()->bootstrapPath("cache") => "775", + app()->bootstrapPath("app.php") => "664", + base_path("artisan") => "775", + public_path("index.php") => "664", + public_path("server.php") => "664", + ], + "writable_directories" => [ + storage_path(), + app()->bootstrapPath("cache"), + ], +]; diff --git a/ecs.php b/ecs.php index 6c5fc92..13ae21d 100644 --- a/ecs.php +++ b/ecs.php @@ -5,9 +5,9 @@ declare(strict_types=1); use Blumilk\Codestyle\Config; use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths; -$paths = (new LaravelPaths())->add("public", "bootstrap/app.php", "ecs.php"); +$paths = new LaravelPaths(); $config = new Config( - paths: $paths, + paths: $paths->add("public", "bootstrap/app.php", "ecs.php", "server.php"), ); return $config->config(); diff --git a/package-lock.json b/package-lock.json index 88c2068..a58928e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "toby", + "name": "application", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/public/.htaccess b/public/.htaccess deleted file mode 100644 index 3aec5e2..0000000 --- a/public/.htaccess +++ /dev/null @@ -1,21 +0,0 @@ - - - Options -MultiViews -Indexes - - - RewriteEngine On - - # Handle Authorization Header - RewriteCond %{HTTP:Authorization} . - RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] - - # Redirect Trailing Slashes If Not A Folder... - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_URI} (.+)/$ - RewriteRule ^ %1 [L,R=301] - - # Send Requests To Front Controller... - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^ index.php [L] - diff --git a/README.md b/readme.md similarity index 66% rename from README.md rename to readme.md index 227b69c..93d67ea 100644 --- a/README.md +++ b/readme.md @@ -1,6 +1,8 @@ +![He's watching you](toby.png) + # Toby -HR software you love to hate +> HR software you love to hate ## Local setup @@ -39,19 +41,22 @@ HR software you love to hate dcr node npm run dev -## Available containers (local) +### Available containers (local) + +- **web** - nginx HTTP server - **php** - php and composer stuff - **node** - npm stuff - **mysql** - database for local development - **mailhog** - for emails preview -## Running tests +### Running tests + If xDebug is installed, set environment variable **XDEBUG_MODE=off** to improve performance dcr -e XDEBUG_MODE=off php php artisan test +### Code style check -## Code style check dcr php php vendor/bin/ecs check dcr php composer ecs dcr php php vendor/bin/ecs check --fix @@ -59,13 +64,14 @@ If xDebug is installed, set environment variable **XDEBUG_MODE=off** to improve dcr node npm run lint dcr node rpm run lintf -## xDebug +### xDebug -To use xDebug you need to set `DOCKER_INSTALL_XDEBUG` to `true` in `.env` file.\ -Then rebuild php container `docker-compose up --build -d php`.\ -You can also set up xDebug params (see docs https://xdebug.org/docs/all_settings) in `docker/dev/php/php.ini` file: +* To use xDebug you need to set `DOCKER_INSTALL_XDEBUG` to `true` in `.env` file. +* Then rebuild php container `docker-compose up --build -d php`. +* You can also set up xDebug params (see docs https://xdebug.org/docs/all_settings) in `docker/dev/php/php.ini` file: Default values for xDebug: + ``` xdebug.client_host=host.docker.internal xdebug.client_port=9003 @@ -74,16 +80,19 @@ xdebug.start_with_request=yes xdebug.log_level=0 ``` -### Disable xDebug -it is possible to disable the Xdebug completely by setting the option **xdebug.mode** to **off**, -or by setting the environment variable **XDEBUG_MODE=off**\ -See docs (https://xdebug.org/docs/all_settings#mode) +#### Disable xDebug + +* It is possible to disable the Xdebug completely by setting the option **xdebug.mode** to **off**, or by setting the environment variable **XDEBUG_MODE=off**. +* See docs: (https://xdebug.org/docs/all_settings#mode) CLI: + ``` XDEBUG_MODE=off php artisan test ``` + Docker container: + ``` docker-compose run --rm -e XDEBUG_MODE=off php php artisan test ``` \ No newline at end of file diff --git a/routes/api.php b/routes/api.php index 81e80d0..174d7fd 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,8 +1,3 @@ get("/user", fn(Request $request) => $request->user()); diff --git a/server.php b/server.php index 5fb6379..e9497b7 100644 --- a/server.php +++ b/server.php @@ -1,21 +1,11 @@ - */ +declare(strict_types=1); -$uri = urldecode( - parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) -); +$uri = urldecode(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH)); -// This file allows us to emulate Apache's "mod_rewrite" functionality from the -// built-in PHP web server. This provides a convenient way to test a Laravel -// application without having installed a "real" web server software here. -if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { +if ($uri !== "/" && file_exists(__DIR__ . "/public" . $uri)) { return false; } -require_once __DIR__.'/public/index.php'; +require_once __DIR__ . "/public/index.php"; diff --git a/toby.png b/toby.png new file mode 100644 index 0000000..7fe0ec0 Binary files /dev/null and b/toby.png differ diff --git a/webpack.config.js b/webpack.config.js index bde8163..f0d05a7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,4 +6,4 @@ module.exports = { '@': path.resolve('resources/js') } } -} +};