diff --git a/.env.example b/.env.example index 604b401..037e734 100644 --- a/.env.example +++ b/.env.example @@ -9,9 +9,9 @@ LOG_CHANNEL=stack DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 -DB_DATABASE=laravel +DB_DATABASE=clearbowl DB_USERNAME=root -DB_PASSWORD= +DB_PASSWORD=8fcXUlCgC6JCqpoWX64 BROADCAST_DRIVER=log CACHE_DRIVER=file diff --git a/Jenkinsfile b/Jenkinsfile index 0b74f0f..bf1d2ee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,15 @@ pipeline { - agent { - docker { image 'circleci/php:7.3' } - } stages { - stage('Build'){ - steps { - sh 'composer install' - sh 'cp .env.example .env && php artisan key:generate' + cleanWs() + docker.image('mysql:latest').withRun('-e "MYSQL_ROOT_PASSWORD=8fcXUlCgC6JCqpoWX64" -e "MYSQL_DATABASE=clearbowl" -e "MYSQL_USER=api" -e "MYSQL_PASSWORD=R23qarINlcALOk2nDg6LbJelaqk"') { c -> + docker.image('mysql:latest').inside("--link ${c.id}:db") { + stage("Initialize DB"){ + sh 'while ! mysqladmin ping -hdb --silent; do sleep 1; done' + } } - } - stage('Test') { - steps { - sh 'vendor/bin/phpunit' + docker.image('php:7.4').inside("--link ${c.id}:db") { + stage("Build") { sh 'composer install && mv .env.example .env'} + stage("Test") { sh 'vendor/bin/phpunit' } } } } diff --git a/app/Enums/UserRole.php b/app/Enums/UserRole.php new file mode 100644 index 0000000..7a103f6 --- /dev/null +++ b/app/Enums/UserRole.php @@ -0,0 +1,12 @@ +middleware('auth'); - } -} diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php deleted file mode 100644 index 465c39c..0000000 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ /dev/null @@ -1,22 +0,0 @@ -middleware('guest')->except('logout'); - } -} diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php deleted file mode 100644 index 6fdcba0..0000000 --- a/app/Http/Controllers/Auth/RegisterController.php +++ /dev/null @@ -1,72 +0,0 @@ -middleware('guest'); - } - - /** - * Get a validator for an incoming registration request. - * - * @param array $data - * @return \Illuminate\Contracts\Validation\Validator - */ - protected function validator(array $data) - { - return Validator::make($data, [ - 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], - 'password' => ['required', 'string', 'min:8', 'confirmed'], - ]); - } - - /** - * Create a new user instance after a valid registration. - * - * @param array $data - * @return \App\User - */ - protected function create(array $data) - { - return User::create([ - 'name' => $data['name'], - 'email' => $data['email'], - 'password' => Hash::make($data['password']), - ]); - } -} diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php deleted file mode 100644 index fe965b2..0000000 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ /dev/null @@ -1,29 +0,0 @@ -middleware('auth'); - $this->middleware('signed')->only('verify'); - $this->middleware('throttle:6,1')->only('verify', 'resend'); - } -} diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php new file mode 100644 index 0000000..d03603d --- /dev/null +++ b/app/Http/Controllers/UsersController.php @@ -0,0 +1,100 @@ +usersRepository = $usersRepository; + } + + public function register(RegisterRequest $request) + { + $email = $request->input('email'); + $password = $request->input('password'); + + $this->usersRepository->create([ + 'email' => $email, + 'password' => bcrypt($password), + ]); + + $token = auth()->attempt($request->only(['email', 'password'])); + + return response()->json([ + 'success' => true, + 'data' => ['token' => $token] + ]); + } + + /** + * API Login, on success return JWT Auth token + * + * @param LoginRequest $request + * @return JsonResponse + */ + public function login(LoginRequest $request) + { + + if (!$request->validated()) { + return response()->json(['success' => false, 'error' => $request->messages()], 401); + } + + try { + if (!$token = auth()->attempt($request->only('email', 'password'))) { + return response()->json(['success' => false, 'error' => 'We cant find an account with this credentials. Please make sure you entered the right information and you have verified your email address.'], 404); + } + } catch (JWTException $e) { + // something went wrong whilst attempting to encode the token + return response()->json(['success' => false, 'error' => 'Failed to login, please try again.'], 500); + } + // all good so return the token + return response()->json(['success' => true, 'data' => ['token' => $token]], 200); + } + + + /** + * Log out + * Invalidate the token, so user cannot use it anymore + * They have to login again to get a new token + * + * @param Request $request + * @return JsonResponse + * @throws ValidationException + */ + public function logout(Request $request) + { + $this->validate($request, ['token' => 'required']); + + try { + auth()->invalidate($request->input('token')); + return response()->json(['success' => true, 'message' => "You have successfully logged out."]); + } catch (JWTException $e) { + // something went wrong whilst attempting to encode the token + return response()->json(['success' => false, 'error' => 'Failed to logout, please try again.'], 500); + } + } + + + public function me() + { + $requestedBy = auth()->user(); + + return response()->json([ + 'success' => true, 'data' => $requestedBy + ]); + } + +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 2741c0a..edd2338 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -51,16 +51,20 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ + 'assign.guard.auth' => \App\Http\Middleware\AssignGuardAndAuthenticate::class, + 'assign.guard' => \App\Http\Middleware\AssignGuardOnly::class, 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, - 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + 'jwt.auth' => 'Tymon\JWTAuth\Middleware\GetUserFromToken', + 'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken', + ]; /** diff --git a/app/Http/Middleware/AssignGuardAndAuthenticate.php b/app/Http/Middleware/AssignGuardAndAuthenticate.php new file mode 100644 index 0000000..50b01df --- /dev/null +++ b/app/Http/Middleware/AssignGuardAndAuthenticate.php @@ -0,0 +1,29 @@ +shouldUse($guard); + if (!auth()->check()) + return abort(401); + } + return $next($request); + } +} diff --git a/app/Http/Middleware/AssignGuardOnly.php b/app/Http/Middleware/AssignGuardOnly.php new file mode 100644 index 0000000..ea63b17 --- /dev/null +++ b/app/Http/Middleware/AssignGuardOnly.php @@ -0,0 +1,27 @@ +shouldUse($guard); + } + return $next($request); + } +} diff --git a/app/Http/Requests/LoginRequest.php b/app/Http/Requests/LoginRequest.php new file mode 100644 index 0000000..3963bf8 --- /dev/null +++ b/app/Http/Requests/LoginRequest.php @@ -0,0 +1,39 @@ + 'required|email', + 'password' => 'required', + ]; + } + + public function messages() + { + return [ + 'email.required' => 'Email is required', + 'password.required' => 'Password is required', + ]; + } +} diff --git a/app/Http/Requests/RegisterRequest.php b/app/Http/Requests/RegisterRequest.php new file mode 100644 index 0000000..1f957bd --- /dev/null +++ b/app/Http/Requests/RegisterRequest.php @@ -0,0 +1,39 @@ + 'required|email', + 'password' => 'required', + ]; + } + + public function messages() + { + return [ + 'email.required' => 'Email is required', + 'password.required' => 'Password is required', + ]; + } +} diff --git a/app/Models/User.php b/app/Models/User.php new file mode 100644 index 0000000..1a073cc --- /dev/null +++ b/app/Models/User.php @@ -0,0 +1,46 @@ +getKey(); + } + /** + * Return a key value array, containing any custom claims to be added to the JWT. + * + * @return array + */ + public function getJWTCustomClaims() + { + return []; + } +} diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php new file mode 100644 index 0000000..8ab912f --- /dev/null +++ b/app/Policies/UserPolicy.php @@ -0,0 +1,93 @@ +type >= 128; + } + + /** + * Determine whether the user can view the model. + * + * @param \App\Models\User $user + * @param \App\Models\User $model + * @return mixed + */ + public function view(User $user, User $model) + { + return $user->type >= 128; + } + + /** + * Determine whether the user can create models. + * + * @param \App\Models\User $user + * @return mixed + */ + public function create(User $user) + { + return $user->type >= 128; + } + + /** + * Determine whether the user can update the model. + * + * @param \App\Models\User $user + * @param \App\Models\User $model + * @return mixed + */ + public function update(User $user, User $model) + { + return $user->type >= 128; + } + + /** + * Determine whether the user can delete the model. + * + * @param \App\Models\User $user + * @param \App\Models\User $model + * @return mixed + */ + public function delete(User $user, User $model) + { + return $user->type >= 128; + } + + /** + * Determine whether the user can restore the model. + * + * @param \App\Models\User $user + * @param \App\Models\User $model + * @return mixed + */ + public function restore(User $user, User $model) + { + return $user->type >= 128; + } + + /** + * Determine whether the user can permanently delete the model. + * + * @param \App\Models\User $user + * @param \App\Models\User $model + * @return mixed + */ + public function forceDelete(User $user, User $model) + { + return $user->type >= 128; + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5b..9242dee 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { @@ -23,6 +24,6 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // + Schema::defaultStringLength(191); } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 3049068..9910996 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,8 +2,9 @@ namespace App\Providers; +use App\Models\User; +use App\Policies\UserPolicy; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Gate; class AuthServiceProvider extends ServiceProvider { @@ -13,7 +14,8 @@ class AuthServiceProvider extends ServiceProvider * @var array */ protected $policies = [ - // 'App\Model' => 'App\Policies\ModelPolicy', + 'App\Model' => 'App\Policies\ModelPolicy', + User::class => UserPolicy::class, ]; /** @@ -24,7 +26,5 @@ class AuthServiceProvider extends ServiceProvider public function boot() { $this->registerPolicies(); - - // } } diff --git a/app/Providers/RepositoriesServiceProvider.php b/app/Providers/RepositoriesServiceProvider.php new file mode 100644 index 0000000..dfed42a --- /dev/null +++ b/app/Providers/RepositoriesServiceProvider.php @@ -0,0 +1,30 @@ +app->bind(UsersRepositoryInterface::class, UsersRepository::class); + } +} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 548e4be..55638e9 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -25,6 +25,8 @@ class RouteServiceProvider extends ServiceProvider { // + Route::pattern('id', '[0-9]+'); + parent::boot(); } diff --git a/app/Repositories/UsersRepository.php b/app/Repositories/UsersRepository.php new file mode 100644 index 0000000..e39b9c5 --- /dev/null +++ b/app/Repositories/UsersRepository.php @@ -0,0 +1,42 @@ +delete(); + } + + public function getById($id) + { + $user = User::find($id); + return $user; + } + + public function getWhereEquals($field, $actual) + { + return User::where($field, $actual); + } +} diff --git a/app/Repositories/UsersRepositoryInterface.php b/app/Repositories/UsersRepositoryInterface.php new file mode 100644 index 0000000..64c293d --- /dev/null +++ b/app/Repositories/UsersRepositoryInterface.php @@ -0,0 +1,51 @@ +getKeyName(); + if (!is_array($keys)) { + return parent::setKeysForSaveQuery($query); + } + + foreach ($keys as $keyName) { + $query->where($keyName, '=', $this->getKeyForSaveQuery($keyName)); + } + + return $query; + } + + /** + * Get the primary key value for a save query. + * + * @param mixed $keyName + * @return mixed + */ + protected function getKeyForSaveQuery($keyName = null) + { + if (is_null($keyName)) { + $keyName = $this->getKeyName(); + } + + if (isset($this->original[$keyName])) { + return $this->original[$keyName]; + } + + return $this->getAttribute($keyName); + } +} diff --git a/app/User.php b/app/User.php deleted file mode 100644 index e79dab7..0000000 --- a/app/User.php +++ /dev/null @@ -1,39 +0,0 @@ - 'datetime', - ]; -} diff --git a/composer.json b/composer.json index 288180d..a521aed 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,20 @@ { - "name": "laravel/laravel", + "name": "jwtauth/laravel", "type": "project", - "description": "The Laravel Framework.", + "description": "The JWT authenticate api in Laravel 6 template.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { - "php": "^7.2", + "php": "^7.4", + "bensampo/laravel-enum": "^1.26", "fideloper/proxy": "^4.0", - "laravel/framework": "^6.2", - "laravel/tinker": "^1.0" + "hesto/multi-auth": "^2.0", + "laravel/framework": "6.0", + "laravel/tinker": "^1.0", + "tymon/jwt-auth": "^1.0" }, "require-dev": { "facade/ignition": "^1.4", diff --git a/composer.lock b/composer.lock index 98cbd7c..44fb0b8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,79 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa503b104f700e4337a4bf209a56bc8a", + "content-hash": "5ad08d213a9dfe327a11a5e2cbf510eb", "packages": [ + { + "name": "bensampo/laravel-enum", + "version": "v1.28.1", + "source": { + "type": "git", + "url": "https://github.com/BenSampo/laravel-enum.git", + "reference": "2948e7535fae0a98760a34607572dae2038eb9b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/BenSampo/laravel-enum/zipball/2948e7535fae0a98760a34607572dae2038eb9b8", + "reference": "2948e7535fae0a98760a34607572dae2038eb9b8", + "shasum": "" + }, + "require": { + "hanneskod/classtools": "~1.0", + "illuminate/support": "5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0", + "php": "~7.1", + "zendframework/zend-code": "^3.3" + }, + "require-dev": { + "doctrine/dbal": "^2.9", + "laravel/framework": "5.8.*|^6.0", + "orchestra/testbench": "3.8.*|3.9.*", + "phpstan/phpstan": "^0.11.6", + "phpunit/phpunit": "7.5.*", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "laravel": { + "providers": [ + "BenSampo\\Enum\\EnumServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "BenSampo\\Enum\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Sampson", + "homepage": "https://sampo.co.uk", + "role": "Developer" + } + ], + "description": "Simple, extensible and powerful enumeration implementation for Laravel.", + "homepage": "https://github.com/bensampo/laravel-enum", + "keywords": [ + "bensampo", + "enum", + "laravel", + "package", + "validation" + ], + "time": "2019-11-28T00:14:55+00:00" + }, { "name": "dnoegel/php-xdg-base-dir", "version": "0.1", @@ -380,6 +451,139 @@ ], "time": "2019-09-03T16:45:42+00:00" }, + { + "name": "hanneskod/classtools", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/hanneskod/classtools.git", + "reference": "4fba4476ff140af08ddd5ed1a42332b4bc8dcca9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hanneskod/classtools/zipball/4fba4476ff140af08ddd5ed1a42332b4bc8dcca9", + "reference": "4fba4476ff140af08ddd5ed1a42332b4bc8dcca9", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4", + "php": ">=7.1", + "symfony/finder": "^4" + }, + "require-dev": { + "hanneskod/readme-tester": "dev-master" + }, + "type": "library", + "autoload": { + "psr-4": { + "hanneskod\\classtools\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Hannes Forsgård", + "email": "hannes.forsgard@fripost.org" + } + ], + "description": "Find, extract and process classes from file system", + "homepage": "https://github.com/hanneskod/classtools", + "keywords": [ + "class finder", + "code generator", + "metaprogramming", + "minimizer" + ], + "time": "2018-10-25T09:31:36+00:00" + }, + { + "name": "hesto/core", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/Hesto/core.git", + "reference": "07b36001fa70aecb8b1d114ad481023aaf21de4f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Hesto/core/zipball/07b36001fa70aecb8b1d114ad481023aaf21de4f", + "reference": "07b36001fa70aecb8b1d114ad481023aaf21de4f", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Hesto\\Core\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Hesto", + "email": "losiakp@gmail.com" + } + ], + "description": "Core classes for my other modules", + "time": "2017-09-15T08:36:38+00:00" + }, + { + "name": "hesto/multi-auth", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/Hesto/multi-auth.git", + "reference": "9131a17e884ec26200fe33527d1eb5c830b9316d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Hesto/multi-auth/zipball/9131a17e884ec26200fe33527d1eb5c830b9316d", + "reference": "9131a17e884ec26200fe33527d1eb5c830b9316d", + "shasum": "" + }, + "require": { + "hesto/core": "2.0.*", + "php": ">=5.5.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Hesto\\MultiAuth\\MultiAuthServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Hesto\\MultiAuth\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Hesto", + "email": "losiakp@gmail.com" + } + ], + "description": "Multi Auth for Laravel 5.3", + "keywords": [ + "auth", + "laravel", + "multi" + ], + "time": "2017-09-15T08:20:17+00:00" + }, { "name": "jakub-onderka/php-console-color", "version": "v0.2", @@ -470,16 +674,16 @@ }, { "name": "laravel/framework", - "version": "v6.5.1", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "e47180500498cf8aa2a8ffb59a3b4daa007fa13d" + "reference": "89c81d4dc37714d82521d05dc003b26b2a86defc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/e47180500498cf8aa2a8ffb59a3b4daa007fa13d", - "reference": "e47180500498cf8aa2a8ffb59a3b4daa007fa13d", + "url": "https://api.github.com/repos/laravel/framework/zipball/89c81d4dc37714d82521d05dc003b26b2a86defc", + "reference": "89c81d4dc37714d82521d05dc003b26b2a86defc", "shasum": "" }, "require": { @@ -575,10 +779,9 @@ "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "moontoast/math": "Required to use ordered UUIDs (^1.1).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0)", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^4.3.4).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^1.2).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^3.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^4.3).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^1.1).", "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." }, "type": "library", @@ -612,7 +815,7 @@ "framework", "laravel" ], - "time": "2019-11-12T15:20:18+00:00" + "time": "2019-09-03T13:09:57+00:00" }, { "name": "laravel/tinker", @@ -677,6 +880,61 @@ ], "time": "2019-08-07T15:10:45+00:00" }, + { + "name": "lcobucci/jwt", + "version": "3.3.1", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/a11ec5f4b4d75d1fcd04e133dede4c317aac9e18", + "reference": "a11ec5f4b4d75d1fcd04e133dede4c317aac9e18", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-openssl": "*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "mikey179/vfsstream": "~1.5", + "phpmd/phpmd": "~2.2", + "phpunit/php-invoker": "~1.1", + "phpunit/phpunit": "^5.7 || ^7.3", + "squizlabs/php_codesniffer": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Luís Otávio Cobucci Oblonczyk", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "keywords": [ + "JWS", + "jwt" + ], + "time": "2019-05-24T18:30:49+00:00" + }, { "name": "league/flysystem", "version": "1.0.57", @@ -843,23 +1101,86 @@ "time": "2019-11-13T10:27:43+00:00" }, { - "name": "nesbot/carbon", - "version": "2.26.0", + "name": "namshi/jose", + "version": "7.2.3", "source": { "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "e01ecc0b71168febb52ae1fdc1cfcc95428e604e" + "url": "https://github.com/namshi/jose.git", + "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e01ecc0b71168febb52ae1fdc1cfcc95428e604e", - "reference": "e01ecc0b71168febb52ae1fdc1cfcc95428e604e", + "url": "https://api.github.com/repos/namshi/jose/zipball/89a24d7eb3040e285dd5925fcad992378b82bcff", + "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff", + "shasum": "" + }, + "require": { + "ext-date": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-spl": "*", + "php": ">=5.5", + "symfony/polyfill-php56": "^1.0" + }, + "require-dev": { + "phpseclib/phpseclib": "^2.0", + "phpunit/phpunit": "^4.5|^5.0", + "satooshi/php-coveralls": "^1.0" + }, + "suggest": { + "ext-openssl": "Allows to use OpenSSL as crypto engine.", + "phpseclib/phpseclib": "Allows to use Phpseclib as crypto engine, use version ^2.0." + }, + "type": "library", + "autoload": { + "psr-4": { + "Namshi\\JOSE\\": "src/Namshi/JOSE/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Nadalin", + "email": "alessandro.nadalin@gmail.com" + }, + { + "name": "Alessandro Cinelli (cirpo)", + "email": "alessandro.cinelli@gmail.com" + } + ], + "description": "JSON Object Signing and Encryption library for PHP.", + "keywords": [ + "JSON Web Signature", + "JSON Web Token", + "JWS", + "json", + "jwt", + "token" + ], + "time": "2016-12-05T07:27:31+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.27.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "13b8485a8690f103bf19cba64879c218b102b726" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/13b8485a8690f103bf19cba64879c218b102b726", + "reference": "13b8485a8690f103bf19cba64879c218b102b726", "shasum": "" }, "require": { "ext-json": "*", "php": "^7.1.8 || ^8.0", - "symfony/translation": "^3.4 || ^4.0" + "symfony/translation": "^3.4 || ^4.0 || ^5.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", @@ -874,6 +1195,9 @@ ], "type": "library", "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + }, "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" @@ -907,7 +1231,7 @@ "datetime", "time" ], - "time": "2019-10-21T21:32:25+00:00" + "time": "2019-11-20T06:59:06+00:00" }, { "name": "nikic/php-parser", @@ -963,16 +1287,16 @@ }, { "name": "opis/closure", - "version": "3.4.1", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "e79f851749c3caa836d7ccc01ede5828feb762c7" + "reference": "93ebc5712cdad8d5f489b500c59d122df2e53969" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/e79f851749c3caa836d7ccc01ede5828feb762c7", - "reference": "e79f851749c3caa836d7ccc01ede5828feb762c7", + "url": "https://api.github.com/repos/opis/closure/zipball/93ebc5712cdad8d5f489b500c59d122df2e53969", + "reference": "93ebc5712cdad8d5f489b500c59d122df2e53969", "shasum": "" }, "require": { @@ -985,7 +1309,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3.x-dev" + "dev-master": "3.5.x-dev" } }, "autoload": { @@ -1020,7 +1344,7 @@ "serialization", "serialize" ], - "time": "2019-10-19T18:38:51+00:00" + "time": "2019-11-29T22:36:02+00:00" }, { "name": "paragonie/random_compat", @@ -1263,16 +1587,16 @@ }, { "name": "psy/psysh", - "version": "v0.9.9", + "version": "v0.9.11", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e" + "reference": "75d9ac1c16db676de27ab554a4152b594be4748e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", - "reference": "9aaf29575bb8293206bb0420c1e1c87ff2ffa94e", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/75d9ac1c16db676de27ab554a4152b594be4748e", + "reference": "75d9ac1c16db676de27ab554a4152b594be4748e", "shasum": "" }, "require": { @@ -1282,8 +1606,8 @@ "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", "php": ">=5.4.0", - "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", - "symfony/var-dumper": "~2.7|~3.0|~4.0" + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0|~5.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0|~5.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.2", @@ -1333,7 +1657,7 @@ "interactive", "shell" ], - "time": "2018-10-13T15:16:03+00:00" + "time": "2019-11-27T22:44:29+00:00" }, { "name": "ramsey/uuid", @@ -1481,27 +1805,28 @@ }, { "name": "symfony/console", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "831424efae0a1fe6642784bd52aae14ece6538e6" + "reference": "35d9077f495c6d184d9930f7a7ecbd1ad13c7ab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/831424efae0a1fe6642784bd52aae14ece6538e6", - "reference": "831424efae0a1fe6642784bd52aae14ece6538e6", + "url": "https://api.github.com/repos/symfony/console/zipball/35d9077f495c6d184d9930f7a7ecbd1ad13c7ab8", + "reference": "35d9077f495c6d184d9930f7a7ecbd1ad13c7ab8", "shasum": "" }, "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1" + "symfony/service-contracts": "^1.1|^2" }, "conflict": { "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { @@ -1509,12 +1834,12 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", "symfony/event-dispatcher": "^4.3", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/var-dumper": "^4.3" + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -1525,7 +1850,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1552,29 +1877,29 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-11-13T07:29:07+00:00" + "time": "2019-11-13T07:39:40+00:00" }, { "name": "symfony/css-selector", - "version": "v4.3.8", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9" + "reference": "19d29e7098b7b2c3313cb03902ca30f100dcb837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/19d29e7098b7b2c3313cb03902ca30f100dcb837", + "reference": "19d29e7098b7b2c3313cb03902ca30f100dcb837", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1605,20 +1930,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-10-02T08:36:26+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/debug", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "5ea9c3e01989a86ceaa0283f21234b12deadf5e2" + "reference": "b24b791f817116b29e52a63e8544884cf9a40757" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/5ea9c3e01989a86ceaa0283f21234b12deadf5e2", - "reference": "5ea9c3e01989a86ceaa0283f21234b12deadf5e2", + "url": "https://api.github.com/repos/symfony/debug/zipball/b24b791f817116b29e52a63e8544884cf9a40757", + "reference": "b24b791f817116b29e52a63e8544884cf9a40757", "shasum": "" }, "require": { @@ -1629,12 +1954,12 @@ "symfony/http-kernel": "<3.4" }, "require-dev": { - "symfony/http-kernel": "~3.4|~4.0" + "symfony/http-kernel": "^3.4|^4.0|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1661,20 +1986,76 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-11-10T17:54:30+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v4.3.8", + "name": "symfony/error-handler", + "version": "v4.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "0df002fd4f500392eabd243c2947061a50937287" + "url": "https://github.com/symfony/error-handler.git", + "reference": "e1acb58dc6a8722617fe56565f742bcf7e8744bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0df002fd4f500392eabd243c2947061a50937287", - "reference": "0df002fd4f500392eabd243c2947061a50937287", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/e1acb58dc6a8722617fe56565f742bcf7e8744bf", + "reference": "e1acb58dc6a8722617fe56565f742bcf7e8744bf", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0", + "symfony/debug": "^4.4", + "symfony/var-dumper": "^4.4|^5.0" + }, + "require-dev": { + "symfony/http-kernel": "^4.4|^5.0", + "symfony/serializer": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "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": "Symfony ErrorHandler Component", + "homepage": "https://symfony.com", + "time": "2019-11-17T22:49:13+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ab1c43e17fff802bef0a898f3bc088ac33b8e0e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ab1c43e17fff802bef0a898f3bc088ac33b8e0e1", + "reference": "ab1c43e17fff802bef0a898f3bc088ac33b8e0e1", "shasum": "" }, "require": { @@ -1690,12 +2071,12 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "^3.4|^4.0", - "symfony/service-contracts": "^1.1", - "symfony/stopwatch": "~3.4|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/dependency-injection": "", @@ -1704,7 +2085,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1731,7 +2112,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-11-03T09:04:05+00:00" + "time": "2019-11-08T22:40:51+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -1793,16 +2174,16 @@ }, { "name": "symfony/finder", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" + "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", + "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", + "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", "shasum": "" }, "require": { @@ -1811,7 +2192,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1838,35 +2219,35 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:53:54+00:00" + "time": "2019-11-17T21:56:56+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "cabe67275034e173350e158f3b1803d023880227" + "reference": "502040dd2b0cf0a292defeb6145f4d7a4753c99c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cabe67275034e173350e158f3b1803d023880227", - "reference": "cabe67275034e173350e158f3b1803d023880227", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/502040dd2b0cf0a292defeb6145f4d7a4753c99c", + "reference": "502040dd2b0cf0a292defeb6145f4d7a4753c99c", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/mime": "^4.3", + "symfony/mime": "^4.3|^5.0", "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { "predis/predis": "~1.0", - "symfony/expression-language": "~3.4|~4.0" + "symfony/expression-language": "^3.4|^4.0|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1893,37 +2274,37 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-11-12T13:07:20+00:00" + "time": "2019-11-17T10:10:42+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "5fdf186f26f9080de531d3f1d024348b2f0ab12f" + "reference": "5a5e7237d928aa98ff8952050cbbf0135899b6b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5fdf186f26f9080de531d3f1d024348b2f0ab12f", - "reference": "5fdf186f26f9080de531d3f1d024348b2f0ab12f", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5a5e7237d928aa98ff8952050cbbf0135899b6b0", + "reference": "5a5e7237d928aa98ff8952050cbbf0135899b6b0", "shasum": "" }, "require": { "php": "^7.1.3", "psr/log": "~1.0", - "symfony/debug": "~3.4|~4.0", - "symfony/event-dispatcher": "^4.3", - "symfony/http-foundation": "^4.1.1", - "symfony/polyfill-ctype": "~1.8", + "symfony/error-handler": "^4.4", + "symfony/event-dispatcher": "^4.4", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-php73": "^1.9" }, "conflict": { "symfony/browser-kit": "<4.3", "symfony/config": "<3.4", + "symfony/console": ">=5", "symfony/dependency-injection": "<4.3", "symfony/translation": "<4.2", - "symfony/var-dumper": "<4.1.1", "twig/twig": "<1.34|<2.4,>=2" }, "provide": { @@ -1931,34 +2312,32 @@ }, "require-dev": { "psr/cache": "~1.0", - "symfony/browser-kit": "^4.3", - "symfony/config": "~3.4|~4.0", - "symfony/console": "~3.4|~4.0", - "symfony/css-selector": "~3.4|~4.0", - "symfony/dependency-injection": "^4.3", - "symfony/dom-crawler": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/finder": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/routing": "~3.4|~4.0", - "symfony/stopwatch": "~3.4|~4.0", - "symfony/templating": "~3.4|~4.0", - "symfony/translation": "~4.2", - "symfony/translation-contracts": "^1.1", - "symfony/var-dumper": "^4.1.1", - "twig/twig": "^1.34|^2.4" + "symfony/browser-kit": "^4.3|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0", + "symfony/css-selector": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^4.3|^5.0", + "symfony/dom-crawler": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/routing": "^3.4|^4.0|^5.0", + "symfony/stopwatch": "^3.4|^4.0|^5.0", + "symfony/templating": "^3.4|^4.0|^5.0", + "symfony/translation": "^4.2|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "twig/twig": "^1.34|^2.4|^3.0" }, "suggest": { "symfony/browser-kit": "", "symfony/config": "", "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/var-dumper": "" + "symfony/dependency-injection": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1985,35 +2364,38 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-11-13T09:07:28+00:00" + "time": "2019-11-21T07:08:15+00:00" }, { "name": "symfony/mime", - "version": "v4.3.8", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "22aecf6b11638ef378fab25d6c5a2da8a31a1448" + "reference": "76f3c09b7382bf979af7bcd8e6f8033f1324285e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/22aecf6b11638ef378fab25d6c5a2da8a31a1448", - "reference": "22aecf6b11638ef378fab25d6c5a2da8a31a1448", + "url": "https://api.github.com/repos/symfony/mime/zipball/76f3c09b7382bf979af7bcd8e6f8033f1324285e", + "reference": "76f3c09b7382bf979af7bcd8e6f8033f1324285e", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, + "conflict": { + "symfony/mailer": "<4.4" + }, "require-dev": { "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "~3.4|^4.1" + "symfony/dependency-injection": "^4.4|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2044,20 +2426,20 @@ "mime", "mime-type" ], - "time": "2019-11-12T13:10:02+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -2069,7 +2451,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2102,20 +2484,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "685968b11e61a347c18bf25db32effa478be610f" + "reference": "a019efccc03f1a335af6b4f20c30f5ea8060be36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/685968b11e61a347c18bf25db32effa478be610f", - "reference": "685968b11e61a347c18bf25db32effa478be610f", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/a019efccc03f1a335af6b4f20c30f5ea8060be36", + "reference": "a019efccc03f1a335af6b4f20c30f5ea8060be36", "shasum": "" }, "require": { @@ -2127,7 +2509,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2161,20 +2543,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2" + "reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", - "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6f9c239e61e1b0c9229a28ff89a812dc449c3d46", + "reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46", "shasum": "" }, "require": { @@ -2188,7 +2570,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2223,20 +2605,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { @@ -2248,7 +2630,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2282,20 +2664,76 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T14:18:11+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.12.0", + "name": "symfony/polyfill-php56", + "version": "v1.13.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "53dd1cdf3cb986893ccf2b96665b25b3abb384f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/53dd1cdf3cb986893ccf2b96665b25b3abb384f4", + "reference": "53dd1cdf3cb986893ccf2b96665b25b3abb384f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.13-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php56\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2019-11-27T13:56:44+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.13.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038", + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038", "shasum": "" }, "require": { @@ -2304,7 +2742,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2337,20 +2775,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", "shasum": "" }, "require": { @@ -2359,7 +2797,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2395,20 +2833,72 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T16:25:15+00:00" }, { - "name": "symfony/process", - "version": "v4.3.8", + "name": "symfony/polyfill-util", + "version": "v1.13.1", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0" + "url": "https://github.com/symfony/polyfill-util.git", + "reference": "964a67f293b66b95883a5ed918a65354fcd2258f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/964a67f293b66b95883a5ed918a65354fcd2258f", + "reference": "964a67f293b66b95883a5ed918a65354fcd2258f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.13-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Util\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony utilities for portability of PHP codes", + "homepage": "https://symfony.com", + "keywords": [ + "compat", + "compatibility", + "polyfill", + "shim" + ], + "time": "2019-11-27T13:56:44+00:00" + }, + { + "name": "symfony/process", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "75ad33d9b6f25325ebc396d68ad86fd74bcfbb06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/75ad33d9b6f25325ebc396d68ad86fd74bcfbb06", + "reference": "75ad33d9b6f25325ebc396d68ad86fd74bcfbb06", "shasum": "" }, "require": { @@ -2417,7 +2907,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2444,20 +2934,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-10-28T20:30:34+00:00" }, { "name": "symfony/routing", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "533fd12a41fb9ce8d4e861693365427849487c0e" + "reference": "cf6d72cf0348775f5243b8389169a7096221ea40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/533fd12a41fb9ce8d4e861693365427849487c0e", - "reference": "533fd12a41fb9ce8d4e861693365427849487c0e", + "url": "https://api.github.com/repos/symfony/routing/zipball/cf6d72cf0348775f5243b8389169a7096221ea40", + "reference": "cf6d72cf0348775f5243b8389169a7096221ea40", "shasum": "" }, "require": { @@ -2471,11 +2961,11 @@ "require-dev": { "doctrine/annotations": "~1.2", "psr/log": "~1.0", - "symfony/config": "~4.2", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "^4.2|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "doctrine/annotations": "For using the annotation loader", @@ -2487,7 +2977,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2520,24 +3010,24 @@ "uri", "url" ], - "time": "2019-11-04T20:23:03+00:00" + "time": "2019-11-20T13:44:34+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.8", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -2546,7 +3036,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2578,30 +3068,31 @@ "interoperability", "standards" ], - "time": "2019-10-14T12:27:06+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/translation", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "bbce239b35b0cd47bd75848b23e969f17dd970e7" + "reference": "897fb68ee7933372517b551d6f08c6d4bb0b8c40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/bbce239b35b0cd47bd75848b23e969f17dd970e7", - "reference": "bbce239b35b0cd47bd75848b23e969f17dd970e7", + "url": "https://api.github.com/repos/symfony/translation/zipball/897fb68ee7933372517b551d6f08c6d4bb0b8c40", + "reference": "897fb68ee7933372517b551d6f08c6d4bb0b8c40", "shasum": "" }, "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1.6" + "symfony/translation-contracts": "^1.1.6|^2" }, "conflict": { "symfony/config": "<3.4", "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<4.4", "symfony/yaml": "<3.4" }, "provide": { @@ -2609,15 +3100,14 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/console": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/http-kernel": "~3.4|~4.0", - "symfony/intl": "~3.4|~4.0", - "symfony/service-contracts": "^1.1.2", - "symfony/var-dumper": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/finder": "~2.8|~3.0|~4.0|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/intl": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1.2|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -2627,7 +3117,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2654,24 +3144,24 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-11-06T23:21:49+00:00" + "time": "2019-11-12T17:18:47+00:00" }, { "name": "symfony/translation-contracts", - "version": "v1.1.7", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "364518c132c95642e530d9b2d217acbc2ccac3e6" + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/364518c132c95642e530d9b2d217acbc2ccac3e6", - "reference": "364518c132c95642e530d9b2d217acbc2ccac3e6", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/8cc682ac458d75557203b2f2f14b0b92e1c744ed", + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "suggest": { "symfony/translation-implementation": "" @@ -2679,7 +3169,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2711,20 +3201,20 @@ "interoperability", "standards" ], - "time": "2019-09-17T11:12:18+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "ea4940845535c85ff5c505e13b3205b0076d07bf" + "reference": "eade2890f8b0eeb279b6cf41b50a10007294490f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ea4940845535c85ff5c505e13b3205b0076d07bf", - "reference": "ea4940845535c85ff5c505e13b3205b0076d07bf", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eade2890f8b0eeb279b6cf41b50a10007294490f", + "reference": "eade2890f8b0eeb279b6cf41b50a10007294490f", "shasum": "" }, "require": { @@ -2738,9 +3228,9 @@ }, "require-dev": { "ext-iconv": "*", - "symfony/console": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "twig/twig": "~1.34|~2.4" + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.34|^2.4|^3.0" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", @@ -2753,7 +3243,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2787,7 +3277,7 @@ "debug", "dump" ], - "time": "2019-10-13T12:02:04+00:00" + "time": "2019-11-12T14:51:11+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -2838,6 +3328,81 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "time": "2019-10-24T08:53:34+00:00" }, + { + "name": "tymon/jwt-auth", + "version": "1.0.0-rc.5", + "source": { + "type": "git", + "url": "https://github.com/tymondesigns/jwt-auth.git", + "reference": "103739700dc0358039a33b5bc91247570bb83529" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/103739700dc0358039a33b5bc91247570bb83529", + "reference": "103739700dc0358039a33b5bc91247570bb83529", + "shasum": "" + }, + "require": { + "illuminate/auth": "^5.1|^6", + "illuminate/contracts": "^5.1|^6", + "illuminate/http": "^5.1|^6", + "illuminate/support": "^5.1|^6", + "lcobucci/jwt": "^3.2", + "namshi/jose": "^7.0", + "nesbot/carbon": "^1.0|^2.0", + "php": "^5.5.9|^7.0" + }, + "require-dev": { + "cartalyst/sentinel": "^2|^3", + "illuminate/console": "^5.1|^6", + "illuminate/database": "^5.1|^6", + "illuminate/routing": "^5.1|^6", + "mockery/mockery": ">=0.9.9", + "phpunit/phpunit": "~4.8|~6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.0-dev" + }, + "laravel": { + "aliases": { + "JWTAuth": "Tymon\\JWTAuth\\Facades\\JWTAuth", + "JWTFactory": "Tymon\\JWTAuth\\Facades\\JWTFactory" + }, + "providers": [ + "Tymon\\JWTAuth\\Providers\\LaravelServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Tymon\\JWTAuth\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sean Tymon", + "email": "tymon148@gmail.com", + "homepage": "https://tymon.xyz", + "role": "Developer" + } + ], + "description": "JSON Web Token Authentication for Laravel and Lumen", + "homepage": "https://github.com/tymondesigns/jwt-auth", + "keywords": [ + "Authentication", + "JSON Web Token", + "auth", + "jwt", + "laravel" + ], + "time": "2019-09-09T03:33:47+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v3.6.0", @@ -2894,6 +3459,113 @@ "environment" ], "time": "2019-09-10T21:37:39+00:00" + }, + { + "name": "zendframework/zend-code", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-code.git", + "reference": "46feaeecea14161734b56c1ace74f28cb329f194" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/46feaeecea14161734b56c1ace74f28cb329f194", + "reference": "46feaeecea14161734b56c1ace74f28cb329f194", + "shasum": "" + }, + "require": { + "php": "^7.1", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "require-dev": { + "doctrine/annotations": "^1.0", + "ext-phar": "*", + "phpunit/phpunit": "^7.5.16 || ^8.4", + "zendframework/zend-coding-standard": "^1.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4.x-dev", + "dev-develop": "3.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Extensions to the PHP Reflection API, static code scanning, and code generation", + "keywords": [ + "ZendFramework", + "code", + "zf" + ], + "time": "2019-10-05T23:18:22+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2018-04-25T15:33:34+00:00" } ], "packages-dev": [ @@ -2955,16 +3627,16 @@ }, { "name": "facade/flare-client-php", - "version": "1.1.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "04c0bbd1881942f59e27877bac3b29ba57519666" + "reference": "0fd0c0a5c75a5acf04578311a08a7832e06a981c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/04c0bbd1881942f59e27877bac3b29ba57519666", - "reference": "04c0bbd1881942f59e27877bac3b29ba57519666", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/0fd0c0a5c75a5acf04578311a08a7832e06a981c", + "reference": "0fd0c0a5c75a5acf04578311a08a7832e06a981c", "shasum": "" }, "require": { @@ -3005,26 +3677,26 @@ "flare", "reporting" ], - "time": "2019-11-08T11:11:17+00:00" + "time": "2019-11-27T10:09:46+00:00" }, { "name": "facade/ignition", - "version": "1.12.0", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "67736a01597b9e08f00a1fc8966b92b918dba5ea" + "reference": "1d2103aefecc9c4e6975bcc77fc5eceb330adb33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/67736a01597b9e08f00a1fc8966b92b918dba5ea", - "reference": "67736a01597b9e08f00a1fc8966b92b918dba5ea", + "url": "https://api.github.com/repos/facade/ignition/zipball/1d2103aefecc9c4e6975bcc77fc5eceb330adb33", + "reference": "1d2103aefecc9c4e6975bcc77fc5eceb330adb33", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "facade/flare-client-php": "^1.1", + "facade/flare-client-php": "^1.3", "facade/ignition-contracts": "^1.0", "filp/whoops": "^2.4", "illuminate/support": "~5.5.0 || ~5.6.0 || ~5.7.0 || ~5.8.0 || ^6.0", @@ -3076,7 +3748,7 @@ "laravel", "page" ], - "time": "2019-11-14T10:51:35+00:00" + "time": "2019-11-27T11:17:18+00:00" }, { "name": "facade/ignition-contracts", @@ -3281,22 +3953,23 @@ }, { "name": "mockery/mockery", - "version": "1.2.4", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "b3453f75fd23d9fd41685f2148f4abeacabc6405" + "reference": "5571962a4f733fbb57bede39778f71647fae8e66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/b3453f75fd23d9fd41685f2148f4abeacabc6405", - "reference": "b3453f75fd23d9fd41685f2148f4abeacabc6405", + "url": "https://api.github.com/repos/mockery/mockery/zipball/5571962a4f733fbb57bede39778f71647fae8e66", + "reference": "5571962a4f733fbb57bede39778f71647fae8e66", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "~2.0", "lib-pcre": ">=7.0", - "php": ">=5.6.0" + "php": ">=5.6.0", + "sebastian/comparator": "^1.2.4|^3.0" }, "require-dev": { "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0" @@ -3342,7 +4015,7 @@ "test double", "testing" ], - "time": "2019-09-30T08:30:27+00:00" + "time": "2019-11-24T07:54:50+00:00" }, { "name": "myclabs/deep-copy", @@ -3773,16 +4446,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "7.0.8", + "version": "7.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f" + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa0d179a13284c7420fc281fc32750e6cc7c9e2f", - "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", "shasum": "" }, "require": { @@ -3832,7 +4505,7 @@ "testing", "xunit" ], - "time": "2019-09-17T06:24:36+00:00" + "time": "2019-11-20T13:55:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4340,16 +5013,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -4389,7 +5062,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -4830,31 +5503,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -4876,7 +5547,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2019-11-24T13:36:37+00:00" } ], "aliases": [], @@ -4885,7 +5556,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.2" + "php": "^7.4" }, "platform-dev": [] } diff --git a/config/app.php b/config/app.php index c9960cd..c642a2d 100644 --- a/config/app.php +++ b/config/app.php @@ -80,7 +80,7 @@ return [ | */ - 'locale' => 'en', + 'locale' => 'pl', /* |-------------------------------------------------------------------------- @@ -174,6 +174,12 @@ return [ // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, + App\Providers\RepositoriesServiceProvider::class, + + /* + * JWT-auth provider + */ + Tymon\JWTAuth\Providers\LaravelServiceProvider::class, ], @@ -226,6 +232,9 @@ return [ 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, + 'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class, + 'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class, + ], ]; diff --git a/config/auth.php b/config/auth.php index aaf982b..ef597e2 100644 --- a/config/auth.php +++ b/config/auth.php @@ -14,7 +14,7 @@ return [ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'users', 'passwords' => 'users', ], @@ -36,16 +36,10 @@ return [ */ 'guards' => [ - 'web' => [ - 'driver' => 'session', + 'users' => [ + 'driver' => 'jwt', 'provider' => 'users', ], - - 'api' => [ - 'driver' => 'token', - 'provider' => 'users', - 'hash' => false, - ], ], /* @@ -68,13 +62,8 @@ return [ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => App\Models\User::class, ], - - // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', - // ], ], /* @@ -95,23 +84,9 @@ return [ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', + 'table' => 'user_password_resets', 'expire' => 60, - 'throttle' => 60, ], ], - /* - |-------------------------------------------------------------------------- - | Password Confirmation Timeout - |-------------------------------------------------------------------------- - | - | Here you may define the amount of seconds before a password confirmation - | times out and the user is prompted to re-enter their password via the - | confirmation screen. By default, the timeout lasts for three hours. - | - */ - - 'password_timeout' => 10800, - ]; diff --git a/config/hashing.php b/config/hashing.php index 8425770..9146bfd 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -44,7 +44,7 @@ return [ */ 'argon' => [ - 'memory' => 1024, + 'memory' => 8192, 'threads' => 2, 'time' => 2, ], diff --git a/config/jwt.php b/config/jwt.php new file mode 100644 index 0000000..8b7843b --- /dev/null +++ b/config/jwt.php @@ -0,0 +1,304 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + + /* + |-------------------------------------------------------------------------- + | JWT Authentication Secret + |-------------------------------------------------------------------------- + | + | Don't forget to set this in your .env file, as it will be used to sign + | your tokens. A helper command is provided for this: + | `php artisan jwt:secret` + | + | Note: This will be used for Symmetric algorithms only (HMAC), + | since RSA and ECDSA use a private/public key combo (See below). + | + */ + + 'secret' => env('JWT_SECRET'), + + /* + |-------------------------------------------------------------------------- + | JWT Authentication Keys + |-------------------------------------------------------------------------- + | + | The algorithm you are using, will determine whether your tokens are + | signed with a random string (defined in `JWT_SECRET`) or using the + | following public & private keys. + | + | Symmetric Algorithms: + | HS256, HS384 & HS512 will use `JWT_SECRET`. + | + | Asymmetric Algorithms: + | RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below. + | + */ + + 'keys' => [ + + /* + |-------------------------------------------------------------------------- + | Public Key + |-------------------------------------------------------------------------- + | + | A path or resource to your public key. + | + | E.g. 'file://path/to/public/key' + | + */ + + 'public' => env('JWT_PUBLIC_KEY'), + + /* + |-------------------------------------------------------------------------- + | Private Key + |-------------------------------------------------------------------------- + | + | A path or resource to your private key. + | + | E.g. 'file://path/to/private/key' + | + */ + + 'private' => env('JWT_PRIVATE_KEY'), + + /* + |-------------------------------------------------------------------------- + | Passphrase + |-------------------------------------------------------------------------- + | + | The passphrase for your private key. Can be null if none set. + | + */ + + 'passphrase' => env('JWT_PASSPHRASE'), + + ], + + /* + |-------------------------------------------------------------------------- + | JWT time to live + |-------------------------------------------------------------------------- + | + | Specify the length of time (in minutes) that the token will be valid for. + | Defaults to 1 hour. + | + | You can also set this to null, to yield a never expiring token. + | Some people may want this behaviour for e.g. a mobile app. + | This is not particularly recommended, so make sure you have appropriate + | systems in place to revoke the token if necessary. + | Notice: If you set this to null you should remove 'exp' element from 'required_claims' list. + | + */ + + 'ttl' => env('JWT_TTL', 60), + + /* + |-------------------------------------------------------------------------- + | Refresh time to live + |-------------------------------------------------------------------------- + | + | Specify the length of time (in minutes) that the token can be refreshed + | within. I.E. The user can refresh their token within a 2 week window of + | the original token being created until they must re-authenticate. + | Defaults to 2 weeks. + | + | You can also set this to null, to yield an infinite refresh time. + | Some may want this instead of never expiring tokens for e.g. a mobile app. + | This is not particularly recommended, so make sure you have appropriate + | systems in place to revoke the token if necessary. + | + */ + + 'refresh_ttl' => env('JWT_REFRESH_TTL', 20160), + + /* + |-------------------------------------------------------------------------- + | JWT hashing algorithm + |-------------------------------------------------------------------------- + | + | Specify the hashing algorithm that will be used to sign the token. + | + | See here: https://github.com/namshi/jose/tree/master/src/Namshi/JOSE/Signer/OpenSSL + | for possible values. + | + */ + + 'algo' => env('JWT_ALGO', 'HS256'), + + /* + |-------------------------------------------------------------------------- + | Required Claims + |-------------------------------------------------------------------------- + | + | Specify the required claims that must exist in any token. + | A TokenInvalidException will be thrown if any of these claims are not + | present in the payload. + | + */ + + 'required_claims' => [ + 'iss', + 'iat', + 'exp', + 'nbf', + 'sub', + 'jti', + ], + + /* + |-------------------------------------------------------------------------- + | Persistent Claims + |-------------------------------------------------------------------------- + | + | Specify the claim keys to be persisted when refreshing a token. + | `sub` and `iat` will automatically be persisted, in + | addition to the these claims. + | + | Note: If a claim does not exist then it will be ignored. + | + */ + + 'persistent_claims' => [ + // 'foo', + // 'bar', + ], + + /* + |-------------------------------------------------------------------------- + | Lock Subject + |-------------------------------------------------------------------------- + | + | This will determine whether a `prv` claim is automatically added to + | the token. The purpose of this is to ensure that if you have multiple + | authentication models e.g. `App\User` & `App\OtherPerson`, then we + | should prevent one authentication request from impersonating another, + | if 2 tokens happen to have the same id across the 2 different models. + | + | Under specific circumstances, you may want to disable this behaviour + | e.g. if you only have one authentication model, then you would save + | a little on token size. + | + */ + + 'lock_subject' => true, + + /* + |-------------------------------------------------------------------------- + | Leeway + |-------------------------------------------------------------------------- + | + | This property gives the jwt timestamp claims some "leeway". + | Meaning that if you have any unavoidable slight clock skew on + | any of your servers then this will afford you some level of cushioning. + | + | This applies to the claims `iat`, `nbf` and `exp`. + | + | Specify in seconds - only if you know you need it. + | + */ + + 'leeway' => env('JWT_LEEWAY', 0), + + /* + |-------------------------------------------------------------------------- + | Blacklist Enabled + |-------------------------------------------------------------------------- + | + | In order to invalidate tokens, you must have the blacklist enabled. + | If you do not want or need this functionality, then set this to false. + | + */ + + 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true), + + /* + | ------------------------------------------------------------------------- + | Blacklist Grace Period + | ------------------------------------------------------------------------- + | + | When multiple concurrent requests are made with the same JWT, + | it is possible that some of them fail, due to token regeneration + | on every request. + | + | Set grace period in seconds to prevent parallel request failure. + | + */ + + 'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0), + + /* + |-------------------------------------------------------------------------- + | Cookies encryption + |-------------------------------------------------------------------------- + | + | By default Laravel encrypt cookies for security reason. + | If you decide to not decrypt cookies, you will have to configure Laravel + | to not encrypt your cookie token by adding its name into the $except + | array available in the middleware "EncryptCookies" provided by Laravel. + | see https://laravel.com/docs/master/responses#cookies-and-encryption + | for details. + | + | Set it to true if you want to decrypt cookies. + | + */ + + 'decrypt_cookies' => false, + + /* + |-------------------------------------------------------------------------- + | Providers + |-------------------------------------------------------------------------- + | + | Specify the various providers used throughout the package. + | + */ + + 'providers' => [ + + /* + |-------------------------------------------------------------------------- + | JWT Provider + |-------------------------------------------------------------------------- + | + | Specify the provider that is used to create and decode the tokens. + | + */ + + 'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class, + + /* + |-------------------------------------------------------------------------- + | Authentication Provider + |-------------------------------------------------------------------------- + | + | Specify the provider that is used to authenticate users. + | + */ + + 'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class, + + /* + |-------------------------------------------------------------------------- + | Storage Provider + |-------------------------------------------------------------------------- + | + | Specify the provider that is used to store tokens in the blacklist. + | + */ + + 'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class, + + ], + +]; diff --git a/config/logging.php b/config/logging.php index 0df8212..d09cd7d 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,6 +1,5 @@ 'errorlog', 'level' => 'debug', ], - - 'null' => [ - 'driver' => 'monolog', - 'handler' => NullHandler::class, - ], ], ]; diff --git a/database/factories/UserFactory.php b/database/factories/UsersFactory.php similarity index 97% rename from database/factories/UserFactory.php rename to database/factories/UsersFactory.php index 084535f..1319f5f 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UsersFactory.php @@ -1,7 +1,7 @@ string('email')->index(); - $table->string('token'); - $table->timestamp('created_at')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('password_resets'); - } -} diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php deleted file mode 100644 index 389bdf7..0000000 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ /dev/null @@ -1,35 +0,0 @@ -bigIncrements('id'); - $table->text('connection'); - $table->text('queue'); - $table->longText('payload'); - $table->longText('exception'); - $table->timestamp('failed_at')->useCurrent(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('failed_jobs'); - } -} diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2019_11_30_153826_create_users_table.php similarity index 83% rename from database/migrations/2014_10_12_000000_create_users_table.php rename to database/migrations/2019_11_30_153826_create_users_table.php index a91e1d3..ba18b48 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2019_11_30_153826_create_users_table.php @@ -1,8 +1,9 @@ bigIncrements('id'); - $table->string('name'); $table->string('email')->unique(); - $table->timestamp('email_verified_at')->nullable(); $table->string('password'); - $table->rememberToken(); + $table->integer('role')->default(UserRole::USER); $table->timestamps(); }); } diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 91cb6d1..ea7ee53 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -11,6 +11,6 @@ class DatabaseSeeder extends Seeder */ public function run() { - // $this->call(UsersTableSeeder::class); + $this->call(UsersTableSeeder::class); } } diff --git a/database/seeds/UsersTableSeeder.php b/database/seeds/UsersTableSeeder.php new file mode 100644 index 0000000..b478843 --- /dev/null +++ b/database/seeds/UsersTableSeeder.php @@ -0,0 +1,22 @@ +insert([ + 'name' => 'adminTargi', + 'email' => 'adminTargi@poleng.pl', + 'password' => bcrypt('password'), + 'type' => 256 + ]); + } +} diff --git a/package.json b/package.json deleted file mode 100644 index 9fcb8ee..0000000 --- a/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "scripts": { - "dev": "npm run development", - "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", - "watch": "npm run development -- --watch", - "watch-poll": "npm run watch -- --watch-poll", - "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", - "prod": "npm run production", - "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" - }, - "devDependencies": { - "axios": "^0.19", - "cross-env": "^5.1", - "laravel-mix": "^4.0.7", - "lodash": "^4.17.13", - "resolve-url-loader": "^2.3.1", - "sass": "^1.15.2", - "sass-loader": "^7.1.0" - } -} diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index 86f1082..f3b01a4 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -17,6 +17,5 @@ return [ 'sent' => 'We have e-mailed your password reset link!', 'token' => 'This password reset token is invalid.', 'user' => "We can't find a user with that e-mail address.", - 'throttled' => 'Please wait before retrying.', ]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index ce1d80d..e1d879f 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -93,7 +93,6 @@ return [ 'not_in' => 'The selected :attribute is invalid.', 'not_regex' => 'The :attribute format is invalid.', 'numeric' => 'The :attribute must be a number.', - 'password' => 'The password is incorrect.', 'present' => 'The :attribute field must be present.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php deleted file mode 100644 index 3fb48cc..0000000 --- a/resources/views/welcome.blade.php +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - Laravel - - - - - - - - -
- @if (Route::has('login')) - - @endif - -
-
- Laravel -
- - -
-
- - diff --git a/routes/api.php b/routes/api.php index c641ca5..0839ef9 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,18 +1,9 @@ get('/user', function (Request $request) { - return $request->user(); +Route::group(['prefix' => 'user', 'middleware' => ['assign.guard:users']], function () { + Route::post('/register', 'UsersController@register'); + Route::post('/login', 'UsersController@login'); + Route::get('/me', 'UsersController@me'); }); diff --git a/routes/web.php b/routes/web.php index 810aa34..cb3f0ca 100644 --- a/routes/web.php +++ b/routes/web.php @@ -10,7 +10,3 @@ | contains the "web" middleware group. Now create something great! | */ - -Route::get('/', function () { - return view('welcome'); -}); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index cdb5111..0000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,21 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/tests/Feature/UsersTest.php b/tests/Feature/UsersTest.php new file mode 100644 index 0000000..5101fe7 --- /dev/null +++ b/tests/Feature/UsersTest.php @@ -0,0 +1,53 @@ + 'artur.nowakowski@gmail.com', 'password' => 'test123']; + + public function getToken() + { + $response = $this->post('http://localhost:8000/api/user/login', $this->loginData)->decodeResponseJson(); + + return $response['data']['token']; + } + + /** + * A basic test example. + * + * @return void + */ + public function testRegistration() + { + + $response = $this->post('http://localhost:8000/api/user/register', $this->loginData); + + $response->assertStatus(200); + $response->assertJsonStructure(['success', 'data' => ['token']]); + } + + public function testLogin() + { + $this->testRegistration(); + $response = $this->post('http://localhost:8000/api/user/login', $this->loginData); + + $response->assertStatus(200); + $response->assertJsonStructure(['success', 'data' => ['token']]); + } + + public function testMe() + { + $this->testRegistration(); + $token = $this->getToken(); + $response = $this->get('http://localhost:8000/api/user/me', ['Authorization' => "Bearer $token"]); + + $response->assertStatus(200); + $response->assertJsonStructure(['success', 'data' => ['email', 'role']]); + } +} diff --git a/webpack.mix.js b/webpack.mix.js deleted file mode 100644 index 8a923cb..0000000 --- a/webpack.mix.js +++ /dev/null @@ -1,15 +0,0 @@ -const mix = require('laravel-mix'); - -/* - |-------------------------------------------------------------------------- - | Mix Asset Management - |-------------------------------------------------------------------------- - | - | Mix provides a clean, fluent API for defining some Webpack build steps - | for your Laravel application. By default, we are compiling the Sass - | file for the application as well as bundling up all the JS files. - | - */ - -mix.js('resources/js/app.js', 'public/js') - .sass('resources/sass/app.scss', 'public/css');