Commit 3d29669b authored by Egor Kremnev's avatar Egor Kremnev

add laravel passport. add register and auth in frontend

parent 76bc2b67
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Requests\Api\RegisterRequest;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class PassportAuthController extends Controller
{
/**
* @param RegisterRequest $request
* @return JsonResponse
*/
public function register(RegisterRequest $request): JsonResponse
{
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'password' => bcrypt($request->password)
]);
return response()->json(
['token' => $user->createToken('LaravelAuthApp')->accessToken],
201
);
}
/**
* @param Request $request
* @return JsonResponse
*/
public function login(Request $request): JsonResponse
{
if (auth()->attempt($request->only(['email', 'password']))) {
return response()
->json(['token' => auth()->user()->createToken('LaravelAuthApp')->accessToken]);
}
return response()->json(['error' => 'Unauthorised'], 401);
}
}
<?php
namespace App\Http\Requests\Api;
use Illuminate\Foundation\Http\FormRequest;
class RegisterRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
*/
public function rules(): array
{
return [
'name' => 'required|min:4',
'email' => 'required|email|unique:users',
'password' => 'required|min:6'
];
}
}
......@@ -2,13 +2,11 @@
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Laravel\Passport\HasApiTokens;
class User extends Authenticatable
{
......
......@@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Laravel\Passport\Passport;
class AppServiceProvider extends ServiceProvider
{
......@@ -11,7 +12,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function register(): void
{
//
Passport::ignoreRoutes();
}
/**
......
......@@ -8,6 +8,7 @@
"php": "^8.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/passport": "^11.8",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8"
},
......
......@@ -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": "aa322c53454393ed775cfe4807d54a50",
"content-hash": "ddc5e99eac8ac0485fe4d69e71422370",
"packages": [
{
"name": "brick/math",
......@@ -61,6 +61,73 @@
],
"time": "2023-01-15T23:15:59+00:00"
},
{
"name": "defuse/php-encryption",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/defuse/php-encryption.git",
"reference": "f53396c2d34225064647a05ca76c1da9d99e5828"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/defuse/php-encryption/zipball/f53396c2d34225064647a05ca76c1da9d99e5828",
"reference": "f53396c2d34225064647a05ca76c1da9d99e5828",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"paragonie/random_compat": ">= 2",
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^5|^6|^7|^8|^9|^10",
"yoast/phpunit-polyfills": "^2.0.0"
},
"bin": [
"bin/generate-defuse-key"
],
"type": "library",
"autoload": {
"psr-4": {
"Defuse\\Crypto\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Hornby",
"email": "taylor@defuse.ca",
"homepage": "https://defuse.ca/"
},
{
"name": "Scott Arciszewski",
"email": "info@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "Secure PHP Encryption Library",
"keywords": [
"aes",
"authenticated encryption",
"cipher",
"crypto",
"cryptography",
"encrypt",
"encryption",
"openssl",
"security",
"symmetric key cryptography"
],
"support": {
"issues": "https://github.com/defuse/php-encryption/issues",
"source": "https://github.com/defuse/php-encryption/tree/v2.4.0"
},
"time": "2023-06-19T06:10:36+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.2",
......@@ -138,28 +205,28 @@
},
{
"name": "doctrine/inflector",
"version": "2.0.6",
"version": "2.0.8",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024"
"reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024",
"reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff",
"reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^10",
"doctrine/coding-standard": "^11.0",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-strict-rules": "^1.3",
"phpunit/phpunit": "^8.5 || ^9.5",
"vimeo/psalm": "^4.25"
"vimeo/psalm": "^4.25 || ^5.4"
},
"type": "library",
"autoload": {
......@@ -209,7 +276,7 @@
],
"support": {
"issues": "https://github.com/doctrine/inflector/issues",
"source": "https://github.com/doctrine/inflector/tree/2.0.6"
"source": "https://github.com/doctrine/inflector/tree/2.0.8"
},
"funding": [
{
......@@ -225,7 +292,7 @@
"type": "tidelift"
}
],
"time": "2022-10-20T09:10:12+00:00"
"time": "2023-06-16T13:40:37+00:00"
},
{
"name": "doctrine/lexer",
......@@ -432,6 +499,69 @@
],
"time": "2023-01-14T14:17:03+00:00"
},
{
"name": "firebase/php-jwt",
"version": "v6.8.1",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
"reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26",
"reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26",
"shasum": ""
},
"require": {
"php": "^7.4||^8.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^6.5||^7.4",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"psr/cache": "^1.0||^2.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0"
},
"suggest": {
"ext-sodium": "Support EdDSA (Ed25519) signatures",
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
},
"type": "library",
"autoload": {
"psr-4": {
"Firebase\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Neuman Vong",
"email": "neuman+pear@twilio.com",
"role": "Developer"
},
{
"name": "Anant Narayanan",
"email": "anant@php.net",
"role": "Developer"
}
],
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
"homepage": "https://github.com/firebase/php-jwt",
"keywords": [
"jwt",
"php"
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
"source": "https://github.com/firebase/php-jwt/tree/v6.8.1"
},
"time": "2023-07-14T18:33:00+00:00"
},
{
"name": "fruitcake/php-cors",
"version": "v1.2.0",
......@@ -976,16 +1106,16 @@
},
{
"name": "laravel/framework",
"version": "v10.13.0",
"version": "v10.15.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "7322723585103082758d74917db62980684845cb"
"reference": "c7599dc92e04532824bafbd226c2936ce6a905b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/7322723585103082758d74917db62980684845cb",
"reference": "7322723585103082758d74917db62980684845cb",
"url": "https://api.github.com/repos/laravel/framework/zipball/c7599dc92e04532824bafbd226c2936ce6a905b8",
"reference": "c7599dc92e04532824bafbd226c2936ce6a905b8",
"shasum": ""
},
"require": {
......@@ -1172,7 +1302,85 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-05-30T14:46:25+00:00"
"time": "2023-07-11T13:43:52+00:00"
},
{
"name": "laravel/passport",
"version": "v11.8.8",
"source": {
"type": "git",
"url": "https://github.com/laravel/passport.git",
"reference": "401836130d46c94138a637ada29f9e5b2bf053b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/passport/zipball/401836130d46c94138a637ada29f9e5b2bf053b6",
"reference": "401836130d46c94138a637ada29f9e5b2bf053b6",
"shasum": ""
},
"require": {
"ext-json": "*",
"firebase/php-jwt": "^6.4",
"illuminate/auth": "^9.0|^10.0",
"illuminate/console": "^9.0|^10.0",
"illuminate/container": "^9.0|^10.0",
"illuminate/contracts": "^9.0|^10.0",
"illuminate/cookie": "^9.0|^10.0",
"illuminate/database": "^9.0|^10.0",
"illuminate/encryption": "^9.0|^10.0",
"illuminate/http": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"lcobucci/jwt": "^4.3|^5.0",
"league/oauth2-server": "^8.5.3",
"nyholm/psr7": "^1.5",
"php": "^8.0",
"phpseclib/phpseclib": "^2.0|^3.0",
"symfony/psr-http-message-bridge": "^2.1"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^7.0|^8.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "11.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Passport\\PassportServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Passport\\": "src/",
"Laravel\\Passport\\Database\\Factories\\": "database/factories/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Laravel Passport provides OAuth2 server support to Laravel.",
"keywords": [
"laravel",
"oauth",
"passport"
],
"support": {
"issues": "https://github.com/laravel/passport/issues",
"source": "https://github.com/laravel/passport"
},
"time": "2023-07-07T06:37:11+00:00"
},
{
"name": "laravel/sanctum",
......@@ -1368,6 +1576,145 @@
},
"time": "2023-02-15T16:40:09+00:00"
},
{
"name": "lcobucci/clock",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/lcobucci/clock.git",
"reference": "30a854ceb22bd87d83a7a4563b3f6312453945fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lcobucci/clock/zipball/30a854ceb22bd87d83a7a4563b3f6312453945fc",
"reference": "30a854ceb22bd87d83a7a4563b3f6312453945fc",
"shasum": ""
},
"require": {
"php": "~8.2.0",
"psr/clock": "^1.0"
},
"provide": {
"psr/clock-implementation": "1.0"
},
"require-dev": {
"infection/infection": "^0.26",
"lcobucci/coding-standard": "^10.0.0",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10.7",
"phpstan/phpstan-deprecation-rules": "^1.1.3",
"phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-strict-rules": "^1.5.0",
"phpunit/phpunit": "^10.0.17"
},
"type": "library",
"autoload": {
"psr-4": {
"Lcobucci\\Clock\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Luís Cobucci",
"email": "lcobucci@gmail.com"
}
],
"description": "Yet another clock abstraction",
"support": {
"issues": "https://github.com/lcobucci/clock/issues",
"source": "https://github.com/lcobucci/clock/tree/3.1.0"
},
"funding": [
{
"url": "https://github.com/lcobucci",
"type": "github"
},
{
"url": "https://www.patreon.com/lcobucci",
"type": "patreon"
}
],
"time": "2023-03-20T19:12:25+00:00"
},
{
"name": "lcobucci/jwt",
"version": "5.0.0",
"source": {
"type": "git",
"url": "https://github.com/lcobucci/jwt.git",
"reference": "47bdb0e0b5d00c2f89ebe33e7e384c77e84e7c34"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/47bdb0e0b5d00c2f89ebe33e7e384c77e84e7c34",
"reference": "47bdb0e0b5d00c2f89ebe33e7e384c77e84e7c34",
"shasum": ""
},
"require": {
"ext-hash": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-sodium": "*",
"php": "~8.1.0 || ~8.2.0",
"psr/clock": "^1.0"
},
"require-dev": {
"infection/infection": "^0.26.19",
"lcobucci/clock": "^3.0",
"lcobucci/coding-standard": "^9.0",
"phpbench/phpbench": "^1.2.8",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10.3",
"phpstan/phpstan-deprecation-rules": "^1.1.2",
"phpstan/phpstan-phpunit": "^1.3.8",
"phpstan/phpstan-strict-rules": "^1.5.0",
"phpunit/phpunit": "^10.0.12"
},
"suggest": {
"lcobucci/clock": ">= 3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Lcobucci\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Luís Cobucci",
"email": "lcobucci@gmail.com",
"role": "Developer"
}
],
"description": "A simple library to work with JSON Web Token and JSON Web Signature",
"keywords": [
"JWS",
"jwt"
],
"support": {
"issues": "https://github.com/lcobucci/jwt/issues",
"source": "https://github.com/lcobucci/jwt/tree/5.0.0"
},
"funding": [
{
"url": "https://github.com/lcobucci",
"type": "github"
},
{
"url": "https://www.patreon.com/lcobucci",
"type": "patreon"
}
],
"time": "2023-02-25T21:35:16+00:00"
},
{
"name": "league/commonmark",
"version": "2.4.0",
......@@ -1556,6 +1903,60 @@
],
"time": "2022-12-11T20:36:23+00:00"
},
{
"name": "league/event",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/event.git",
"reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/event/zipball/d2cc124cf9a3fab2bb4ff963307f60361ce4d119",
"reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"henrikbjorn/phpspec-code-coverage": "~1.0.1",
"phpspec/phpspec": "^2.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-4": {
"League\\Event\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Event package",
"keywords": [
"emitter",
"event",
"listener"
],
"support": {
"issues": "https://github.com/thephpleague/event/issues",
"source": "https://github.com/thephpleague/event/tree/master"
},
"time": "2018-11-26T11:52:41+00:00"
},
{
"name": "league/flysystem",
"version": "3.15.1",
......@@ -1761,32 +2162,291 @@
"time": "2022-04-17T13:12:02+00:00"
},
{
"name": "monolog/monolog",
"version": "3.3.1",
"name": "league/oauth2-server",
"version": "8.5.3",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "9b5daeaffce5b926cac47923798bba91059e60e2"
"url": "https://github.com/thephpleague/oauth2-server.git",
"reference": "eb91b4190e7f6169053ebf8ffa352d47e756b2ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/9b5daeaffce5b926cac47923798bba91059e60e2",
"reference": "9b5daeaffce5b926cac47923798bba91059e60e2",
"url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/eb91b4190e7f6169053ebf8ffa352d47e756b2ce",
"reference": "eb91b4190e7f6169053ebf8ffa352d47e756b2ce",
"shasum": ""
},
"require": {
"php": ">=8.1",
"psr/log": "^2.0 || ^3.0"
"defuse/php-encryption": "^2.3",
"ext-openssl": "*",
"lcobucci/clock": "^2.2 || ^3.0",
"lcobucci/jwt": "^4.3 || ^5.0",
"league/event": "^2.2",
"league/uri": "^6.7",
"php": "^8.0",
"psr/http-message": "^1.0.1 || ^2.0"
},
"provide": {
"psr/log-implementation": "3.0.0"
"replace": {
"league/oauth2server": "*",
"lncd/oauth2": "*"
},
"require-dev": {
"aws/aws-sdk-php": "^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7 || ^8",
"laminas/laminas-diactoros": "^3.0.0",
"phpstan/phpstan": "^0.12.57",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpunit/phpunit": "^9.6.6",
"roave/security-advisories": "dev-master"
},
"type": "library",
"autoload": {
"psr-4": {
"League\\OAuth2\\Server\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alex Bilbie",
"email": "hello@alexbilbie.com",
"homepage": "http://www.alexbilbie.com",
"role": "Developer"
},
{
"name": "Andy Millington",
"email": "andrew@noexceptions.io",
"homepage": "https://www.noexceptions.io",
"role": "Developer"
}
],
"description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.",
"homepage": "https://oauth2.thephpleague.com/",
"keywords": [
"Authentication",
"api",
"auth",
"authorisation",
"authorization",
"oauth",
"oauth 2",
"oauth 2.0",
"oauth2",
"protect",
"resource",
"secure",
"server"
],
"support": {
"issues": "https://github.com/thephpleague/oauth2-server/issues",
"source": "https://github.com/thephpleague/oauth2-server/tree/8.5.3"
},
"funding": [
{
"url": "https://github.com/sephster",
"type": "github"
}
],
"time": "2023-07-05T23:01:32+00:00"
},
{
"name": "league/uri",
"version": "6.8.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri.git",
"reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri/zipball/a700b4656e4c54371b799ac61e300ab25a2d1d39",
"reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39",
"shasum": ""
},
"require": {
"ext-json": "*",
"graylog2/gelf-php": "^1.4.2 || ^2@dev",
"league/uri-interfaces": "^2.3",
"php": "^8.1",
"psr/http-message": "^1.0.1"
},
"conflict": {
"league/uri-schemes": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^v3.9.5",
"nyholm/psr7": "^1.5.1",
"php-http/psr7-integration-tests": "^1.1.1",
"phpbench/phpbench": "^1.2.6",
"phpstan/phpstan": "^1.8.5",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.1.1",
"phpstan/phpstan-strict-rules": "^1.4.3",
"phpunit/phpunit": "^9.5.24",
"psr/http-factory": "^1.0.1"
},
"suggest": {
"ext-fileinfo": "Needed to create Data URI from a filepath",
"ext-intl": "Needed to improve host validation",
"league/uri-components": "Needed to easily manipulate URI objects",
"psr/http-factory": "Needed to use the URI factory"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "URI manipulation library",
"homepage": "https://uri.thephpleague.com",
"keywords": [
"data-uri",
"file-uri",
"ftp",
"hostname",
"http",
"https",
"middleware",
"parse_str",
"parse_url",
"psr-7",
"query-string",
"querystring",
"rfc3986",
"rfc3987",
"rfc6570",
"uri",
"uri-template",
"url",
"ws"
],
"support": {
"docs": "https://uri.thephpleague.com",
"forum": "https://thephpleague.slack.com",
"issues": "https://github.com/thephpleague/uri/issues",
"source": "https://github.com/thephpleague/uri/tree/6.8.0"
},
"funding": [
{
"url": "https://github.com/sponsors/nyamsprod",
"type": "github"
}
],
"time": "2022-09-13T19:58:47+00:00"
},
{
"name": "league/uri-interfaces",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-interfaces.git",
"reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383",
"reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.2 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.19",
"phpstan/phpstan": "^0.12.90",
"phpstan/phpstan-phpunit": "^0.12.19",
"phpstan/phpstan-strict-rules": "^0.12.9",
"phpunit/phpunit": "^8.5.15 || ^9.5"
},
"suggest": {
"ext-intl": "to use the IDNA feature",
"symfony/intl": "to use the IDNA feature via Symfony Polyfill"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "Common interface for URI representation",
"homepage": "http://github.com/thephpleague/uri-interfaces",
"keywords": [
"rfc3986",
"rfc3987",
"uri",
"url"
],
"support": {
"issues": "https://github.com/thephpleague/uri-interfaces/issues",
"source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0"
},
"funding": [
{
"url": "https://github.com/sponsors/nyamsprod",
"type": "github"
}
],
"time": "2021-06-28T04:27:21+00:00"
},
{
"name": "monolog/monolog",
"version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "e2392369686d420ca32df3803de28b5d6f76867d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/e2392369686d420ca32df3803de28b5d6f76867d",
"reference": "e2392369686d420ca32df3803de28b5d6f76867d",
"shasum": ""
},
"require": {
"php": ">=8.1",
"psr/log": "^2.0 || ^3.0"
},
"provide": {
"psr/log-implementation": "3.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7 || ^8",
"ext-json": "*",
"graylog2/gelf-php": "^1.4.2 || ^2.0",
"guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.2",
"mongodb/mongodb": "^1.8",
......@@ -1794,7 +2454,7 @@
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-strict-rules": "^1.4",
"phpunit/phpunit": "^9.5.26",
"phpunit/phpunit": "^10.1",
"predis/predis": "^1.1 || ^2",
"ruflin/elastica": "^7",
"symfony/mailer": "^5.4 || ^6",
......@@ -1847,7 +2507,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/3.3.1"
"source": "https://github.com/Seldaek/monolog/tree/3.4.0"
},
"funding": [
{
......@@ -1859,20 +2519,20 @@
"type": "tidelift"
}
],
"time": "2023-02-06T13:46:10+00:00"
"time": "2023-06-21T08:46:11+00:00"
},
{
"name": "nesbot/carbon",
"version": "2.67.0",
"version": "2.68.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "c1001b3bc75039b07f38a79db5237c4c529e04c8"
"reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/c1001b3bc75039b07f38a79db5237c4c529e04c8",
"reference": "c1001b3bc75039b07f38a79db5237c4c529e04c8",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4f991ed2a403c85efbc4f23eb4030063fdbe01da",
"reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da",
"shasum": ""
},
"require": {
......@@ -1961,7 +2621,7 @@
"type": "tidelift"
}
],
"time": "2023-05-25T22:09:47+00:00"
"time": "2023-06-20T18:29:04+00:00"
},
{
"name": "nette/schema",
......@@ -2113,146 +2773,341 @@
"time": "2023-02-02T10:41:53+00:00"
},
{
"name": "nikic/php-parser",
"version": "v4.15.5",
"name": "nikic/php-parser",
"version": "v4.15.5",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e",
"reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.9-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5"
},
"time": "2023-05-19T20:20:00+00:00"
},
{
"name": "nunomaduro/termwind",
"version": "v1.15.1",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/termwind.git",
"reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
"reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^8.0",
"symfony/console": "^5.3.0|^6.0.0"
},
"require-dev": {
"ergebnis/phpstan-rules": "^1.0.",
"illuminate/console": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"laravel/pint": "^1.0.0",
"pestphp/pest": "^1.21.0",
"pestphp/pest-plugin-mock": "^1.0",
"phpstan/phpstan": "^1.4.6",
"phpstan/phpstan-strict-rules": "^1.1.0",
"symfony/var-dumper": "^5.2.7|^6.0.0",
"thecodingmachine/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Termwind\\Laravel\\TermwindServiceProvider"
]
}
},
"autoload": {
"files": [
"src/Functions.php"
],
"psr-4": {
"Termwind\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
}
],
"description": "Its like Tailwind CSS, but for the console.",
"keywords": [
"cli",
"console",
"css",
"package",
"php",
"style"
],
"support": {
"issues": "https://github.com/nunomaduro/termwind/issues",
"source": "https://github.com/nunomaduro/termwind/tree/v1.15.1"
},
"funding": [
{
"url": "https://www.paypal.com/paypalme/enunomaduro",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
},
{
"url": "https://github.com/xiCO2k",
"type": "github"
}
],
"time": "2023-02-08T01:06:31+00:00"
},
{
"name": "nyholm/psr7",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/Nyholm/psr7.git",
"reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Nyholm/psr7/zipball/3cb4d163b58589e47b35103e8e5e6a6a475b47be",
"reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be",
"shasum": ""
},
"require": {
"php": ">=7.2",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 || ^2.0"
},
"provide": {
"php-http/message-factory-implementation": "1.0",
"psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"http-interop/http-factory-tests": "^0.9",
"php-http/message-factory": "^1.0",
"php-http/psr7-integration-tests": "^1.0",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.4",
"symfony/error-handler": "^4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.8-dev"
}
},
"autoload": {
"psr-4": {
"Nyholm\\Psr7\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com"
},
{
"name": "Martijn van der Ven",
"email": "martijn@vanderven.se"
}
],
"description": "A fast PHP7 implementation of PSR-7",
"homepage": "https://tnyholm.se",
"keywords": [
"psr-17",
"psr-7"
],
"support": {
"issues": "https://github.com/Nyholm/psr7/issues",
"source": "https://github.com/Nyholm/psr7/tree/1.8.0"
},
"funding": [
{
"url": "https://github.com/Zegnat",
"type": "github"
},
{
"url": "https://github.com/nyholm",
"type": "github"
}
],
"time": "2023-05-02T11:26:24+00:00"
},
{
"name": "paragonie/constant_time_encoding",
"version": "v2.6.3",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e"
"url": "https://github.com/paragonie/constant_time_encoding.git",
"reference": "58c3f47f650c94ec05a151692652a868995d2938"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e",
"reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e",
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938",
"reference": "58c3f47f650c94ec05a151692652a868995d2938",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
"php": "^7|^8"
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
"phpunit/phpunit": "^6|^7|^8|^9",
"vimeo/psalm": "^1|^2|^3|^4"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.9-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
"ParagonIE\\ConstantTime\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
"MIT"
],
"authors": [
{
"name": "Nikita Popov"
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com",
"role": "Maintainer"
},
{
"name": "Steve 'Sc00bz' Thomas",
"email": "steve@tobtu.com",
"homepage": "https://www.tobtu.com",
"role": "Original Developer"
}
],
"description": "A PHP parser written in PHP",
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
"keywords": [
"parser",
"php"
"base16",
"base32",
"base32_decode",
"base32_encode",
"base64",
"base64_decode",
"base64_encode",
"bin2hex",
"encoding",
"hex",
"hex2bin",
"rfc4648"
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5"
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
"source": "https://github.com/paragonie/constant_time_encoding"
},
"time": "2023-05-19T20:20:00+00:00"
"time": "2022-06-14T06:56:20+00:00"
},
{
"name": "nunomaduro/termwind",
"version": "v1.15.1",
"name": "paragonie/random_compat",
"version": "v9.99.100",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/termwind.git",
"reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc"
"url": "https://github.com/paragonie/random_compat.git",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
"reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^8.0",
"symfony/console": "^5.3.0|^6.0.0"
"php": ">= 7"
},
"require-dev": {
"ergebnis/phpstan-rules": "^1.0.",
"illuminate/console": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"laravel/pint": "^1.0.0",
"pestphp/pest": "^1.21.0",
"pestphp/pest-plugin-mock": "^1.0",
"phpstan/phpstan": "^1.4.6",
"phpstan/phpstan-strict-rules": "^1.1.0",
"symfony/var-dumper": "^5.2.7|^6.0.0",
"thecodingmachine/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Termwind\\Laravel\\TermwindServiceProvider"
]
}
"phpunit/phpunit": "4.*|5.*",
"vimeo/psalm": "^1"
},
"autoload": {
"files": [
"src/Functions.php"
],
"psr-4": {
"Termwind\\": "src/"
}
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "Its like Tailwind CSS, but for the console.",
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"cli",
"console",
"css",
"package",
"php",
"style"
"csprng",
"polyfill",
"pseudorandom",
"random"
],
"support": {
"issues": "https://github.com/nunomaduro/termwind/issues",
"source": "https://github.com/nunomaduro/termwind/tree/v1.15.1"
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/random_compat/issues",
"source": "https://github.com/paragonie/random_compat"
},
"funding": [
{
"url": "https://www.paypal.com/paypalme/enunomaduro",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
},
{
"url": "https://github.com/xiCO2k",
"type": "github"
}
],
"time": "2023-02-08T01:06:31+00:00"
"time": "2020-10-15T08:29:30+00:00"
},
{
"name": "phpoption/phpoption",
......@@ -2329,6 +3184,164 @@
],
"time": "2023-02-25T19:38:58+00:00"
},
{
"name": "phpseclib/phpseclib",
"version": "3.0.21",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4580645d3fc05c189024eb3b834c6c1e4f0f30a1",
"reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1",
"shasum": ""
},
"require": {
"paragonie/constant_time_encoding": "^1|^2",
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
"php": ">=5.6.1"
},
"require-dev": {
"phpunit/phpunit": "*"
},
"suggest": {
"ext-dom": "Install the DOM extension to load XML formatted public keys.",
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"type": "library",
"autoload": {
"files": [
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib3\\": "phpseclib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jim Wigginton",
"email": "terrafrost@php.net",
"role": "Lead Developer"
},
{
"name": "Patrick Monnerat",
"email": "pm@datasphere.ch",
"role": "Developer"
},
{
"name": "Andreas Fischer",
"email": "bantu@phpbb.com",
"role": "Developer"
},
{
"name": "Hans-Jürgen Petrich",
"email": "petrich@tronic-media.com",
"role": "Developer"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com",
"role": "Developer"
}
],
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
"homepage": "http://phpseclib.sourceforge.net",
"keywords": [
"BigInteger",
"aes",
"asn.1",
"asn1",
"blowfish",
"crypto",
"cryptography",
"encryption",
"rsa",
"security",
"sftp",
"signature",
"signing",
"ssh",
"twofish",
"x.509",
"x509"
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.21"
},
"funding": [
{
"url": "https://github.com/terrafrost",
"type": "github"
},
{
"url": "https://www.patreon.com/phpseclib",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib",
"type": "tidelift"
}
],
"time": "2023-07-09T15:24:48+00:00"
},
{
"name": "psr/clock",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/clock.git",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Psr\\Clock\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for reading the clock.",
"homepage": "https://github.com/php-fig/clock",
"keywords": [
"clock",
"now",
"psr",
"psr-20",
"time"
],
"support": {
"issues": "https://github.com/php-fig/clock/issues",
"source": "https://github.com/php-fig/clock/tree/1.0.0"
},
"time": "2022-11-25T14:36:26+00:00"
},
{
"name": "psr/container",
"version": "2.0.2",
......@@ -2541,16 +3554,16 @@
},
{
"name": "psr/http-message",
"version": "2.0",
"version": "1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"shasum": ""
},
"require": {
......@@ -2559,7 +3572,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
......@@ -2574,7 +3587,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
......@@ -2588,9 +3601,9 @@
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/2.0"
"source": "https://github.com/php-fig/http-message/tree/1.1"
},
"time": "2023-04-04T09:54:51+00:00"
"time": "2023-04-04T09:50:52+00:00"
},
{
"name": "psr/log",
......@@ -3512,16 +4525,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v6.3.0",
"version": "v6.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "718a97ed430d34e5c568ea2c44eab708c6efbefb"
"reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/718a97ed430d34e5c568ea2c44eab708c6efbefb",
"reference": "718a97ed430d34e5c568ea2c44eab708c6efbefb",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/e0ad0d153e1c20069250986cd9e9dd1ccebb0d66",
"reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66",
"shasum": ""
},
"require": {
......@@ -3569,7 +4582,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v6.3.0"
"source": "https://github.com/symfony/http-foundation/tree/v6.3.1"
},
"funding": [
{
......@@ -3585,20 +4598,20 @@
"type": "tidelift"
}
],
"time": "2023-05-19T12:46:45+00:00"
"time": "2023-06-24T11:51:27+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v6.3.0",
"version": "v6.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "241973f3dd900620b1ca052fe409144f11aea748"
"reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/241973f3dd900620b1ca052fe409144f11aea748",
"reference": "241973f3dd900620b1ca052fe409144f11aea748",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/161e16fd2e35fb4881a43bc8b383dfd5be4ac374",
"reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374",
"shasum": ""
},
"require": {
......@@ -3682,7 +4695,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v6.3.0"
"source": "https://github.com/symfony/http-kernel/tree/v6.3.1"
},
"funding": [
{
......@@ -3698,7 +4711,7 @@
"type": "tidelift"
}
],
"time": "2023-05-30T19:03:32+00:00"
"time": "2023-06-26T06:07:32+00:00"
},
{
"name": "symfony/mailer",
......@@ -4659,18 +5672,106 @@
],
"time": "2023-05-19T08:06:44+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/psr-http-message-bridge.git",
"reference": "28a732c05bbad801304ad5a5c674cf2970508993"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/28a732c05bbad801304ad5a5c674cf2970508993",
"reference": "28a732c05bbad801304ad5a5c674cf2970508993",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"psr/http-message": "^1.0 || ^2.0",
"symfony/http-foundation": "^5.4 || ^6.0"
},
"require-dev": {
"nyholm/psr7": "^1.1",
"psr/log": "^1.1 || ^2 || ^3",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/config": "^5.4 || ^6.0",
"symfony/event-dispatcher": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"symfony/phpunit-bridge": "^6.2"
},
"suggest": {
"nyholm/psr7": "For a super lightweight PSR-7/17 implementation"
},
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-main": "2.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Bridge\\PsrHttpMessage\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "PSR HTTP message bridge",
"homepage": "http://symfony.com",
"keywords": [
"http",
"http-message",
"psr-17",
"psr-7"
],
"support": {
"issues": "https://github.com/symfony/psr-http-message-bridge/issues",
"source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.2.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": "2023-04-21T08:40:19+00:00"
},
{
"name": "symfony/routing",
"version": "v6.3.0",
"version": "v6.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "827f59fdc67eecfc4dfff81f9c93bf4d98f0c89b"
"reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/827f59fdc67eecfc4dfff81f9c93bf4d98f0c89b",
"reference": "827f59fdc67eecfc4dfff81f9c93bf4d98f0c89b",
"url": "https://api.github.com/repos/symfony/routing/zipball/d37ad1779c38b8eb71996d17dc13030dcb7f9cf5",
"reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5",
"shasum": ""
},
"require": {
......@@ -4723,7 +5824,7 @@
"url"
],
"support": {
"source": "https://github.com/symfony/routing/tree/v6.3.0"
"source": "https://github.com/symfony/routing/tree/v6.3.1"
},
"funding": [
{
......@@ -4739,7 +5840,7 @@
"type": "tidelift"
}
],
"time": "2023-04-28T15:57:00+00:00"
"time": "2023-06-05T15:30:22+00:00"
},
{
"name": "symfony/service-contracts",
......@@ -5157,16 +6258,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v6.3.0",
"version": "v6.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "6acdcd5c122074ee9f7b051e4fb177025c277a0e"
"reference": "c81268d6960ddb47af17391a27d222bd58cf0515"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/6acdcd5c122074ee9f7b051e4fb177025c277a0e",
"reference": "6acdcd5c122074ee9f7b051e4fb177025c277a0e",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c81268d6960ddb47af17391a27d222bd58cf0515",
"reference": "c81268d6960ddb47af17391a27d222bd58cf0515",
"shasum": ""
},
"require": {
......@@ -5219,7 +6320,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v6.3.0"
"source": "https://github.com/symfony/var-dumper/tree/v6.3.1"
},
"funding": [
{
......@@ -5235,7 +6336,7 @@
"type": "tidelift"
}
],
"time": "2023-05-25T13:09:35+00:00"
"time": "2023-06-21T12:08:28+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
......
......@@ -40,6 +40,10 @@ return [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
/*
......
......@@ -64,4 +64,5 @@ return [
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
],
'routes' => false
];
......@@ -14,15 +14,8 @@ use Illuminate\Support\Facades\Route;
|
*/
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
Route::post('register', [App\Http\Controllers\Api\PassportAuthController::class, 'register']);
Route::post('login', [App\Http\Controllers\Api\PassportAuthController::class, 'login']);
Route::resource('/articles', \App\Http\Controllers\Api\ArticleController::class)
->only('index');
//Route::resource('/articles', \App\Http\Controllers\Api\ArticleController::class)
// ->except('edit', 'create');
//Route::resource('/articles/{article}/comments', \App\Http\Controllers\Api\CommentController::class)
// ->except('edit', 'create');
->middleware('auth:api');
......@@ -2,11 +2,26 @@
namespace Tests;
use App\Models\User;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Laravel\Passport\Passport;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication, RefreshDatabase, WithFaker;
/** @var User $user */
protected $user;
/**
* @return void
*/
public function setUp(): void
{
parent::setUp();
$this->user = User::factory()->create();
Passport::actingAs($this->user);
}
}
import React from "react";
import {Message} from "semantic-ui-react";
const Errors = ({errorMessage, errors}) => {
return <Message negative>
<Message.Header>{errorMessage}</Message.Header>
<div>
{
Object.keys(errors).map(key => (
<div key={key}>
<div>{key.charAt(0).toUpperCase() + key.slice(1)}</div>
<ul className="list">
{errors[key].map(error => (<li key={error} className="content">{error}</li>))}
</ul>
</div>
)
)
}
</div>
</Message>
};
export default Errors;
import React, {Component} from "react";
import React, {useEffect, useState} from "react";
import {Container, Menu} from "semantic-ui-react";
import {Link} from "react-router-dom";
import {Link, useLocation, useNavigate} from "react-router-dom";
export default class Navbar extends Component {
render() {
const Navbar = () => {
const [state, setState] = useState({
isAuth: false,
activeItem: 'home'
});
const location = useLocation();
const navigate = useNavigate();
useEffect(() => {
const token = localStorage.getItem('token');
if (token) {
setState(prevState => ({...prevState, isAuth: true}));
}
}, [location]);
const handleItemClick = (e, { name }) => setState(prevState => ({...prevState, activeItem: name }));
const handleLogOut = (e) => {
setState({ isAuth: false, activeItem: 'logout' });
localStorage.removeItem('token');
navigate("/login");
};
const authButtons = () => {
return (
<div>
<Menu fixed="top" inverted>
<Container>
<Menu.Item
as={Link}
header to="/">Home</Menu.Item>
<Menu.Item
as={Link}
to="/articles" id="articles-button">
<>
<Menu.Item
as={Link} to="/login"
name='login'
active={state.activeItem === 'login'}
onClick={handleItemClick}
/>
<Menu.Item
as={Link} to="/register"
name='register'
active={state.activeItem === 'register'}
onClick={handleItemClick}
/>
</>
);
};
const logOutButton = () => {
return (
<>
<Menu.Item
name='logout'
active={state.activeItem === 'logout'}
onClick={handleLogOut}
/>
</>
)
};
return (
<div>
<Menu fixed="top" inverted>
<Container>
<Menu.Item name='home' active={state.activeItem === 'home'} as={Link} to="/" header onClick={handleItemClick}>
Home
</Menu.Item>
{
state.isAuth &&
<Menu.Item name='articles' active={state.activeItem === 'articles'}
as={Link} to="/articles" onClick={handleItemClick}>
Articles
</Menu.Item>
</Container>
</Menu>
</div>
);
}
}
}
<Menu.Menu position='right'>
{state.isAuth ? logOutButton() : authButtons()}
</Menu.Menu>
</Container>
</Menu>
</div>
);
};
export default Navbar;
import React, {Component} from "react";
import React, {useEffect, useState} from "react";
import './ArticlesPage.css';
import {API_BASE_URL} from "../../config";
import {Header, Message} from "semantic-ui-react";
import ArticlesPageTable from "../../components/ArticlesPageTable/ArticlesPageTable";
import {useNavigate} from "react-router-dom";
import {get} from "../../services/request";
export default class ArticlesPage extends Component {
constructor(props) {
super(props);
this.state = {
articles: null,
isLoading: false
}
}
const ArticlesPage = () => {
const [state, setState] = useState({
articles: null,
isLoading: false
});
const navigate = useNavigate();
const getArticles = () => {
const token = localStorage.getItem('token');
if (!token) navigate('/login');
async getArticles() {
if (!this.state.articles) {
try {
this.setState({isLoading: true});
const response = await fetch(
API_BASE_URL + '/articles',
{
headers: {
Accept: "application/json"
}
}
)
const articlesData = await response.json();
this.setState({articles: articlesData.data, isLoading: false});
} catch (e) {
this.setState({isLoading: false});
console.error(e);
}
try {
setState(prevState => ({...prevState, isLoading: true}));
const response = get(API_BASE_URL + "/articles", token);
response.then(data => setState({articles: data.data, isLoading: false}));
} catch (e) {
setState(prevState => ({...prevState, isLoading: false}));
console.error(e);
}
}
componentDidMount() {
this.getArticles();
}
useEffect(() => {
const token = localStorage.getItem('token');
if (!token) navigate('/login');
if (!state.articles) getArticles();
}, []);
return (
<div>
<Header as="h1">Articles</Header>
{state.isLoading && <Message info header="Loading articles..." />}
{state.articles && <ArticlesPageTable articles={state.articles} />}
</div>
);
};
export default ArticlesPage;
render() {
return (
<div>
<Header as="h1">Articles</Header>
{this.state.isLoading && <Message info header="Loading articles..." />}
{this.state.articles && <ArticlesPageTable articles={this.state.articles} />}
</div>
);
}
}
import React, {useEffect, useState} from 'react';
import {Button, Form, Message} from 'semantic-ui-react';
import {API_BASE_URL} from "../../../config";
import {post} from "../../../services/request";
import {useNavigate} from "react-router-dom";
import Errors from "../../../components/Errors/Errors";
const Login = () => {
const [state, setState] = useState({
email: null,
password: null,
isLoading: false,
errorMessage: null,
errors: null,
error: null
});
const navigate = useNavigate();
useEffect(() => {
const token = localStorage.getItem('token');
if (token) {
navigate("/");
}
}, []);
const handleSubmit = (e) => {
setState(prevState => ({...prevState, isLoading: true}));
const data = {
email: state.email,
password: state.password
};
const res = post(API_BASE_URL + "/login", data);
res.then(response => {
if (Object.keys(response).includes('token')) {
localStorage.setItem('token', response.token);
navigate('/');
} else if (Object.keys(response).includes('error')) {
setState(prevState => ({...prevState, error: response.error}));
}
setState(prevState => ({
...prevState,
errorMessage: response.message,
errors: response.errors,
isLoading: false
}));
}
);
};
const onChangeInputHandler = e => {
const {name, value} = e.currentTarget;
setState(prevState => ({
...prevState,
[name]: value,
errors: null
}));
};
return (
<div>
{state.error && <Message negative><Message.Header>{state.error}</Message.Header></Message>}
{state.errors && <Errors errors={state.errors} errorMessage={state.errorMessage}/>}
<Form>
<Form.Field>
<label>Email</label>
<input type="email" placeholder='Email' name='email' onChange={onChangeInputHandler}/>
</Form.Field>
<Form.Field>
<label>Password</label>
<input type="password" placeholder='Password' name='password' onChange={onChangeInputHandler}/>
</Form.Field>
<Button loading={state.isLoading} type='submit' onClick={(event) => handleSubmit(event)}>
Login
</Button>
</Form>
</div>
);
};
export default Login;
import React, {useEffect, useState} from 'react';
import {Button, Form} from 'semantic-ui-react';
import {API_BASE_URL} from "../../../config";
import {post} from "../../../services/request";
import {useNavigate} from "react-router-dom";
import Errors from "../../../components/Errors/Errors";
const Register = () => {
const [state, setState] = useState({
name: null,
email: null,
password: null,
passwordConfirmation: null,
isLoading: false,
errors: null
});
const navigate = useNavigate();
useEffect(() => {
const token = localStorage.getItem('token');
if (token) {
navigate("/");
}
}, []);
const handleSubmit = (e) => {
setState(prevState => ({...prevState, isLoading: true}));
const data = {
name: state.name,
email: state.email,
password: state.password
};
const res = post(API_BASE_URL + "/register", data);
res.then(response => {
if (Object.keys(response).includes('token')) {
localStorage.setItem('token', response.token);
navigate('/');
}
setState(prevState => ({
...prevState,
errorMessage: response.message,
errors: response.errors,
isLoading: false
}));
});
};
const onChangeInputHandler = e => {
const {name, value} = e.currentTarget;
console.log(name,value);
setState(prevState => ({
...prevState,
[name]: value,
errors: null
}));
};
return (
<div>
{state.errors && <Errors errors={state.errors} errorMessage={state.errorMessage}/>}
<Form>
<Form.Field>
<label>Name</label>
<input type="text" placeholder='Name' name='name' onChange={onChangeInputHandler}/>
</Form.Field>
<Form.Field>
<label>Email</label>
<input type="email" placeholder='Email' name='email' onChange={onChangeInputHandler}/>
</Form.Field>
<Form.Field>
<label>Password</label>
<input type="password" placeholder='Password' name='password' onChange={onChangeInputHandler}/>
</Form.Field>
<Button loading={state.isLoading} type='submit' onClick={handleSubmit}>
Register
</Button>
</Form>
</div>
);
}
export default Register;
......@@ -4,6 +4,8 @@ import Root from "./Root";
import React from 'react';
import Error from "./Error";
import ArticlesPage from "../containers/ArticlesPage/ArticlesPage";
import Register from "../containers/Auth/Register/Register";
import Login from "../containers/Auth/Login/Login";
const router = createBrowserRouter([
{
......@@ -18,6 +20,14 @@ const router = createBrowserRouter([
{
path: '/articles',
element: <ArticlesPage />
},
{
path: '/register',
element: <Register />
},
{
path: '/login',
element: <Login />
}
]
}
......
function playWithResponsePromise(response) {
return new Promise(function (resolve, reject) {
if (response.status < 400) response.json().then(resolve);
else response.json().then(resolve);
});
}
export function get(url, token) {
return fetch(
url,
{
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-type': 'application/json',
...token && {'Authorization': 'Bearer ' + token}
}
}
).then(playWithResponsePromise);
}
export function post(url, data, token) {
return fetch(
url,
{
method: 'POST',
body: JSON.stringify(data),
headers: {
'Accept': 'application/json',
'Content-type': 'application/json',
...token && {'Authorization': 'Bearer ' + token}
}
}
).then(playWithResponsePromise);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment