From d4af5ed7bbec33c5952e74ff8ebf5200b1e02af4 Mon Sep 17 00:00:00 2001 From: setyobagus01 <103160255+sobattechno@users.noreply.github.com> Date: Sat, 18 Mar 2023 00:55:02 +0700 Subject: [PATCH 1/5] add structures --- app/Http/Controllers/CategoryController.php | 63 + app/Http/Controllers/CourierController.php | 63 + app/Http/Controllers/OrderController.php | 63 + app/Http/Controllers/ProductController.php | 63 + app/Http/Controllers/ReviewController.php | 63 + app/Http/Controllers/UserController.php | 63 + app/Models/Category.php | 11 + app/Models/Courier.php | 11 + app/Models/DetailOrder.php | 11 + app/Models/DetailProduct.php | 11 + app/Models/DetailUser.php | 11 + app/Models/Order.php | 11 + app/Models/Product.php | 11 + app/Models/Review.php | 11 + app/Models/UserAddress.php | 11 + composer.json | 1 + composer.lock | 1345 ++++++++++++++++- .../2014_10_12_000000_create_users_table.php | 1 + ...03_16_173034_create_detail_users_table.php | 38 + ..._16_173105_create_user_addresses_table.php | 41 + ...023_03_16_173204_create_products_table.php | 36 + ...16_173220_create_detail_products_table.php | 40 + .../2023_03_16_173237_create_orders_table.php | 52 + ...3_16_173251_create_detail_orders_table.php | 39 + ...023_03_16_173350_create_couriers_table.php | 34 + ...3_03_16_173405_create_categories_table.php | 34 + ...2023_03_16_173513_create_reviews_table.php | 36 + .../2023_03_17_165954_create_carts_table.php | 35 + ...023_03_17_170021_create_wishlish_table.php | 35 + ...7_172716_add_foreign_keys_detail_users.php | 33 + ...172942_add_foreign_keys_user_addresses.php | 33 + ...03_17_173008_add_foreign_keys_products.php | 36 + ...73029_add_foreign_keys_detail_products.php | 33 + ...3_03_17_173051_add_foreign_keys_orders.php | 39 + ..._173146_add_foreign_keys_detail_orders.php | 36 + ..._17_173225_add_foreign_keys_categories.php | 33 + ..._03_17_173252_add_foreign_keys_reviews.php | 33 + 37 files changed, 2446 insertions(+), 74 deletions(-) create mode 100644 app/Http/Controllers/CategoryController.php create mode 100644 app/Http/Controllers/CourierController.php create mode 100644 app/Http/Controllers/OrderController.php create mode 100644 app/Http/Controllers/ProductController.php create mode 100644 app/Http/Controllers/ReviewController.php create mode 100644 app/Http/Controllers/UserController.php create mode 100644 app/Models/Category.php create mode 100644 app/Models/Courier.php create mode 100644 app/Models/DetailOrder.php create mode 100644 app/Models/DetailProduct.php create mode 100644 app/Models/DetailUser.php create mode 100644 app/Models/Order.php create mode 100644 app/Models/Product.php create mode 100644 app/Models/Review.php create mode 100644 app/Models/UserAddress.php create mode 100644 database/migrations/2023_03_16_173034_create_detail_users_table.php create mode 100644 database/migrations/2023_03_16_173105_create_user_addresses_table.php create mode 100644 database/migrations/2023_03_16_173204_create_products_table.php create mode 100644 database/migrations/2023_03_16_173220_create_detail_products_table.php create mode 100644 database/migrations/2023_03_16_173237_create_orders_table.php create mode 100644 database/migrations/2023_03_16_173251_create_detail_orders_table.php create mode 100644 database/migrations/2023_03_16_173350_create_couriers_table.php create mode 100644 database/migrations/2023_03_16_173405_create_categories_table.php create mode 100644 database/migrations/2023_03_16_173513_create_reviews_table.php create mode 100644 database/migrations/2023_03_17_165954_create_carts_table.php create mode 100644 database/migrations/2023_03_17_170021_create_wishlish_table.php create mode 100644 database/migrations/2023_03_17_172716_add_foreign_keys_detail_users.php create mode 100644 database/migrations/2023_03_17_172942_add_foreign_keys_user_addresses.php create mode 100644 database/migrations/2023_03_17_173008_add_foreign_keys_products.php create mode 100644 database/migrations/2023_03_17_173029_add_foreign_keys_detail_products.php create mode 100644 database/migrations/2023_03_17_173051_add_foreign_keys_orders.php create mode 100644 database/migrations/2023_03_17_173146_add_foreign_keys_detail_orders.php create mode 100644 database/migrations/2023_03_17_173225_add_foreign_keys_categories.php create mode 100644 database/migrations/2023_03_17_173252_add_foreign_keys_reviews.php diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php new file mode 100644 index 0000000..30567a1 --- /dev/null +++ b/app/Http/Controllers/CategoryController.php @@ -0,0 +1,63 @@ += 2", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5|^6|^7|^8|^9" + }, + "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.3.1" + }, + "time": "2021-04-09T23:57:26+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", @@ -532,6 +598,69 @@ ], "time": "2023-01-02T17:26:14+00:00" }, + { + "name": "firebase/php-jwt", + "version": "v6.4.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "shasum": "" + }, + "require": { + "php": "^7.1||^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^1.1", + "phpunit/phpunit": "^7.5||^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.4.0" + }, + "time": "2023-02-09T21:01:23+00:00" + }, { "name": "fruitcake/laravel-cors", "version": "v2.2.0", @@ -1358,6 +1487,84 @@ }, "time": "2023-02-22T14:38:06+00:00" }, + { + "name": "laravel/passport", + "version": "v11.8.3", + "source": { + "type": "git", + "url": "https://github.com/laravel/passport.git", + "reference": "d60300185cfd066190b7842982cce314f779f9dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/passport/zipball/d60300185cfd066190b7842982cce314f779f9dd", + "reference": "d60300185cfd066190b7842982cce314f779f9dd", + "shasum": "" + }, + "require": { + "ext-json": "*", + "firebase/php-jwt": "^6.3.1", + "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": "^3.4|^4.0", + "league/oauth2-server": "^8.2", + "nyholm/psr7": "^1.3", + "php": "^8.0", + "phpseclib/phpseclib": "^2.0|^3.0", + "symfony/psr-http-message-bridge": "^2.0" + }, + "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-03-01T15:56:44+00:00" + }, { "name": "laravel/sanctum", "version": "v2.15.1", @@ -1551,6 +1758,143 @@ }, "time": "2023-02-15T16:40:09+00:00" }, + { + "name": "lcobucci/clock", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/clock.git", + "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/fb533e093fd61321bfcbac08b131ce805fe183d3", + "reference": "fb533e093fd61321bfcbac08b131ce805fe183d3", + "shasum": "" + }, + "require": { + "php": "^8.0", + "stella-maris/clock": "^0.1.4" + }, + "require-dev": { + "infection/infection": "^0.26", + "lcobucci/coding-standard": "^8.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^9.5" + }, + "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/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2022-04-19T19:34:17+00:00" + }, + { + "name": "lcobucci/jwt", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "55564265fddf810504110bd68ca311932324b0e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/55564265fddf810504110bd68ca311932324b0e9", + "reference": "55564265fddf810504110bd68ca311932324b0e9", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-openssl": "*", + "lcobucci/clock": "^2.0", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "infection/infection": "^0.20", + "lcobucci/coding-standard": "^6.0", + "mikey179/vfsstream": "^1.6", + "phpbench/phpbench": "^0.17", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/php-invoker": "^3.1", + "phpunit/phpunit": "^9.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "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/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2021-09-28T19:18:28+00:00" + }, { "name": "league/commonmark", "version": "2.3.9", @@ -1739,6 +2083,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.12.3", @@ -1887,28 +2285,286 @@ "time": "2022-04-17T13:12:02+00:00" }, { - "name": "monolog/monolog", - "version": "2.9.1", + "name": "league/oauth2-server", + "version": "8.4.0", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1" + "url": "https://github.com/thephpleague/oauth2-server.git", + "reference": "539f4340c14eca8d44578fd118f6bdc0ad16d1ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1", + "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/539f4340c14eca8d44578fd118f6bdc0ad16d1ce", + "reference": "539f4340c14eca8d44578fd118f6bdc0ad16d1ce", "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "defuse/php-encryption": "^2.2.1", + "ext-json": "*", + "ext-openssl": "*", + "lcobucci/jwt": "^3.4.6 || ^4.0.4", + "league/event": "^2.2", + "league/uri": "^6.4", + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.0.1" }, - "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "replace": { + "league/oauth2server": "*", + "lncd/oauth2": "*" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "laminas/laminas-diactoros": "^2.4.1", + "phpstan/phpstan": "^0.12.57", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpunit/phpunit": "^8.5.13", + "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.4.0" + }, + "funding": [ + { + "url": "https://github.com/sephster", + "type": "github" + } + ], + "time": "2023-02-15T16:08:35+00:00" + }, + { + "name": "league/uri", + "version": "6.7.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/d3b50812dd51f3fbf176344cc2981db03d10fe06", + "reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06", + "shasum": "" + }, + "require": { + "ext-json": "*", + "league/uri-interfaces": "^2.3", + "php": "^7.4 || ^8.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v3.3.2", + "nyholm/psr7": "^1.5", + "php-http/psr7-integration-tests": "^1.1", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.1.0", + "phpunit/phpunit": "^9.5.10", + "psr/http-factory": "^1.0" + }, + "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.7.2" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2022-09-13T19:50:42+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": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1", + "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", @@ -2281,65 +2937,327 @@ ], "authors": [ { - "name": "Nikita Popov" + "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.4" + }, + "time": "2023-03-05T19:49:14+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.5.1", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "f734364e38a876a23be4d906a2a089e1315be18a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/f734364e38a876a23be4d906a2a089e1315be18a", + "reference": "f734364e38a876a23be4d906a2a089e1315be18a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "php-http/message-factory": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "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.4-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.5.1" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2022-06-22T07:13:36+00:00" + }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.6.3", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "58c3f47f650c94ec05a151692652a868995d2938" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", + "reference": "58c3f47f650c94ec05a151692652a868995d2938", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "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": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2022-06-14T06:56:20+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "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": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" } ], - "description": "A PHP parser written in PHP", + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ - "parser", - "php" + "csprng", + "polyfill", + "pseudorandom", + "random" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2020-10-15T08:29:30+00:00" }, { - "name": "nunomaduro/termwind", - "version": "v1.15.1", + "name": "php-http/message-factory", + "version": "v1.0.2", "source": { "type": "git", - "url": "https://github.com/nunomaduro/termwind.git", - "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc" + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc", - "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", "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" + "php": ">=5.4", + "psr/http-message": "^1.0" }, "type": "library", "extra": { - "laravel": { - "providers": [ - "Termwind\\Laravel\\TermwindServiceProvider" - ] + "branch-alias": { + "dev-master": "1.0-dev" } }, "autoload": { - "files": [ - "src/Functions.php" - ], "psr-4": { - "Termwind\\": "src/" + "Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2348,38 +3266,24 @@ ], "authors": [ { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" } ], - "description": "Its like Tailwind CSS, but for the console.", + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", "keywords": [ - "cli", - "console", - "css", - "package", - "php", - "style" + "factory", + "http", + "message", + "stream", + "uri" ], "support": { - "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v1.15.1" + "issues": "https://github.com/php-http/message-factory/issues", + "source": "https://github.com/php-http/message-factory/tree/master" }, - "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": "2015-12-19T14:08:53+00:00" }, { "name": "phpoption/phpoption", @@ -2456,6 +3360,164 @@ ], "time": "2023-02-25T19:38:58+00:00" }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.19", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "cc181005cf548bfd8a4896383bb825d859259f95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95", + "reference": "cc181005cf548bfd8a4896383bb825d859259f95", + "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.19" + }, + "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-03-05T17:13:09+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", @@ -3123,6 +4185,53 @@ ], "time": "2023-02-07T16:14:23+00:00" }, + { + "name": "stella-maris/clock", + "version": "0.1.7", + "source": { + "type": "git", + "url": "https://github.com/stella-maris-solutions/clock.git", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/fa23ce16019289a18bb3446fdecd45befcdd94f8", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "psr/clock": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "StellaMaris\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Heigl", + "role": "Maintainer" + } + ], + "description": "A pre-release of the proposed PSR-20 Clock-Interface", + "homepage": "https://gitlab.com/stella-maris/clock", + "keywords": [ + "clock", + "datetime", + "point in time", + "psr20" + ], + "support": { + "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.7" + }, + "time": "2022-11-25T16:15:06+00:00" + }, { "name": "symfony/console", "version": "v6.0.19", @@ -4782,6 +5891,94 @@ ], "time": "2023-01-01T08:36:10+00:00" }, + { + "name": "symfony/psr-http-message-bridge", + "version": "v2.1.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "a125b93ef378c492e274f217874906fb9babdebb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/a125b93ef378c492e274f217874906fb9babdebb", + "reference": "a125b93ef378c492e274f217874906fb9babdebb", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0", + "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0" + }, + "require-dev": { + "nyholm/psr7": "^1.1", + "psr/log": "^1.1 || ^2 || ^3", + "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0", + "symfony/config": "^4.4 || ^5.0 || ^6.0", + "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0", + "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", + "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.4@dev || ^6.0" + }, + "suggest": { + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-main": "2.1-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.1.4" + }, + "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": "2022-11-28T22:46:34+00:00" + }, { "name": "symfony/routing", "version": "v6.0.19", diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index cf6b776..374f804 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -21,6 +21,7 @@ public function up() $table->string('password'); $table->rememberToken(); $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2023_03_16_173034_create_detail_users_table.php b/database/migrations/2023_03_16_173034_create_detail_users_table.php new file mode 100644 index 0000000..d64b01c --- /dev/null +++ b/database/migrations/2023_03_16_173034_create_detail_users_table.php @@ -0,0 +1,38 @@ +id(); + $table->foreignId('user_id')->index('fk_detail_users_to_users'); + $table->string('photo')->nullable(); + $table->string('gender')->nullable(); + $table->date('birthday')->nullable(); + $table->text('biography')->nullable();; + $table->string('phone_number')->nullable();; + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('detail_users'); + } +}; diff --git a/database/migrations/2023_03_16_173105_create_user_addresses_table.php b/database/migrations/2023_03_16_173105_create_user_addresses_table.php new file mode 100644 index 0000000..d20fe68 --- /dev/null +++ b/database/migrations/2023_03_16_173105_create_user_addresses_table.php @@ -0,0 +1,41 @@ +id(); + $table->foreignId('detail_user_id')->nullable()->index('fk_user_addresses_to_detail_users'); + $table->string('name'); + $table->string('phone_number'); + $table->text('address'); + $table->string('province'); + $table->string('city'); + $table->string('subdistrict'); + $table->integer('zipcode'); + $table->text('note')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('user_addresses'); + } +}; diff --git a/database/migrations/2023_03_16_173204_create_products_table.php b/database/migrations/2023_03_16_173204_create_products_table.php new file mode 100644 index 0000000..f6b6691 --- /dev/null +++ b/database/migrations/2023_03_16_173204_create_products_table.php @@ -0,0 +1,36 @@ +id(); + $table->foreignId('seller_id')->nullable()->index('fk_products_to_users'); + $table->foreignId('category_id')->nullable()->index('fk_products_to_categories'); + $table->string('name'); + $table->text('description'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('products'); + } +}; diff --git a/database/migrations/2023_03_16_173220_create_detail_products_table.php b/database/migrations/2023_03_16_173220_create_detail_products_table.php new file mode 100644 index 0000000..41baa30 --- /dev/null +++ b/database/migrations/2023_03_16_173220_create_detail_products_table.php @@ -0,0 +1,40 @@ +id(); + $table->foreignId('product_id')->nullable()->index('fk_detail_products_to_products'); + $table->string('variant'); + $table->string('sku'); + $table->integer('quantity'); + $table->integer('baseprice'); + $table->integer('het'); + $table->decimal('weight'); + $table->string('unit'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('detail_products'); + } +}; diff --git a/database/migrations/2023_03_16_173237_create_orders_table.php b/database/migrations/2023_03_16_173237_create_orders_table.php new file mode 100644 index 0000000..4a437c2 --- /dev/null +++ b/database/migrations/2023_03_16_173237_create_orders_table.php @@ -0,0 +1,52 @@ +id(); + $table->foreignId('buyer_id')->nullable()->index('fk_orders_buyer_to_users'); + $table->foreignId('seller_id')->nullable()->index('fk_orders_seller_to_users'); + $table->foreignId('courier_id')->nullable()->index('fk_orders_to_couriers'); + $table->string('invoice_number'); + $table->string('type'); + $table->decimal('shipping_weight'); + $table->string('shipping_unit'); + $table->integer('shipping_cost'); + $table->string('receipt'); + $table->string('payment_method'); + $table->integer('total_pay'); + $table->string('status'); + $table->date('verified_at')->nullable(); + $table->date('processed_at')->nullable(); + $table->date('delivered_at')->nullable(); + $table->date('send_at')->nullable(); + $table->date('received_at')->nullable(); + $table->date('completed_at')->nullable(); + $table->date('returned_at')->nullable(); + $table->date('cancelled_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('orders'); + } +}; diff --git a/database/migrations/2023_03_16_173251_create_detail_orders_table.php b/database/migrations/2023_03_16_173251_create_detail_orders_table.php new file mode 100644 index 0000000..a443898 --- /dev/null +++ b/database/migrations/2023_03_16_173251_create_detail_orders_table.php @@ -0,0 +1,39 @@ +id(); + $table->foreignId('order_id')->nullable()->index('fk_detail_orders_to_orders'); + $table->foreignId('product_id')->nullable()->index('fk_detail_orders_to_detail_products'); + $table->string('name'); + $table->integer('quantity'); + $table->text('note'); + $table->decimal('weight'); + $table->string('unit'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('detail_orders'); + } +}; diff --git a/database/migrations/2023_03_16_173350_create_couriers_table.php b/database/migrations/2023_03_16_173350_create_couriers_table.php new file mode 100644 index 0000000..372205e --- /dev/null +++ b/database/migrations/2023_03_16_173350_create_couriers_table.php @@ -0,0 +1,34 @@ +id(); + $table->string('name'); + $table->string('photo')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('couriers'); + } +}; diff --git a/database/migrations/2023_03_16_173405_create_categories_table.php b/database/migrations/2023_03_16_173405_create_categories_table.php new file mode 100644 index 0000000..2e0410e --- /dev/null +++ b/database/migrations/2023_03_16_173405_create_categories_table.php @@ -0,0 +1,34 @@ +id(); + $table->foreignId('seller_id')->nullable()->index('fk_categories_to_users'); + $table->string('name'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('categories'); + } +}; diff --git a/database/migrations/2023_03_16_173513_create_reviews_table.php b/database/migrations/2023_03_16_173513_create_reviews_table.php new file mode 100644 index 0000000..c5b7357 --- /dev/null +++ b/database/migrations/2023_03_16_173513_create_reviews_table.php @@ -0,0 +1,36 @@ +id(); + $table->foreignId('buyer_id')->nullable()->index('fk_reviews_to_user'); + $table->foreignId('product_detail_id')->nullable()->index('fk_reviews_to_product_details'); + $table->text('message')->nullable(); + $table->decimal('rating'); + $table->string('photo')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('reviews'); + } +}; diff --git a/database/migrations/2023_03_17_165954_create_carts_table.php b/database/migrations/2023_03_17_165954_create_carts_table.php new file mode 100644 index 0000000..1445cfa --- /dev/null +++ b/database/migrations/2023_03_17_165954_create_carts_table.php @@ -0,0 +1,35 @@ +foreignId('user_id')->nullable()->index('fk_carts_to_users'); + $table->foreignId('order_id')->nullable()->index('fk_carts_to_orders'); + $table->foreign('user_id', 'fk_carts_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('order_id', 'fk_carts_to_orders')->references('id') + ->on('orders')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('carts'); + } +}; diff --git a/database/migrations/2023_03_17_170021_create_wishlish_table.php b/database/migrations/2023_03_17_170021_create_wishlish_table.php new file mode 100644 index 0000000..63ffdf4 --- /dev/null +++ b/database/migrations/2023_03_17_170021_create_wishlish_table.php @@ -0,0 +1,35 @@ +foreignId('user_id')->index('fk_wishlish_to_users'); + $table->foreignId('order_id')->index('fk_wishlish_to_orders'); + $table->foreign('user_id', 'fk_wishlish_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('order_id', 'fk_wishlish_to_orders')->references('id') + ->on('orders')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('wishlish'); + } +}; diff --git a/database/migrations/2023_03_17_172716_add_foreign_keys_detail_users.php b/database/migrations/2023_03_17_172716_add_foreign_keys_detail_users.php new file mode 100644 index 0000000..8f44a79 --- /dev/null +++ b/database/migrations/2023_03_17_172716_add_foreign_keys_detail_users.php @@ -0,0 +1,33 @@ +foreign('user_id', 'fk_detail_users_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('detail_users', function (Blueprint $table) { + $table->dropForeign('fk_detail_users_to_users'); + }); + } +}; diff --git a/database/migrations/2023_03_17_172942_add_foreign_keys_user_addresses.php b/database/migrations/2023_03_17_172942_add_foreign_keys_user_addresses.php new file mode 100644 index 0000000..72dd80f --- /dev/null +++ b/database/migrations/2023_03_17_172942_add_foreign_keys_user_addresses.php @@ -0,0 +1,33 @@ +foreign('detail_user_id', 'fk_user_addresses_to_detail_users')->references('id') + ->on('detail_users')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('user_addresses', function (Blueprint $table) { + $table->dropForeign('fk_user_addresses_to_detail_users'); + }); + } +}; diff --git a/database/migrations/2023_03_17_173008_add_foreign_keys_products.php b/database/migrations/2023_03_17_173008_add_foreign_keys_products.php new file mode 100644 index 0000000..0eda522 --- /dev/null +++ b/database/migrations/2023_03_17_173008_add_foreign_keys_products.php @@ -0,0 +1,36 @@ +foreign('seller_id', 'fk_products_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('category_id', 'fk_products_to_categories')->references('id') + ->on('categories')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('products', function (Blueprint $table) { + $table->dropForeign('fk_products_to_users'); + $table->dropForeign('fk_products_to_categories'); + }); + } +}; diff --git a/database/migrations/2023_03_17_173029_add_foreign_keys_detail_products.php b/database/migrations/2023_03_17_173029_add_foreign_keys_detail_products.php new file mode 100644 index 0000000..c894288 --- /dev/null +++ b/database/migrations/2023_03_17_173029_add_foreign_keys_detail_products.php @@ -0,0 +1,33 @@ +foreign('product_id', 'fk_detail_products_to_products')->references('id') + ->on('products')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('detail_products', function (Blueprint $table) { + $table->dropForeign('fk_detail_products_to_products'); + }); + } +}; diff --git a/database/migrations/2023_03_17_173051_add_foreign_keys_orders.php b/database/migrations/2023_03_17_173051_add_foreign_keys_orders.php new file mode 100644 index 0000000..b92f53b --- /dev/null +++ b/database/migrations/2023_03_17_173051_add_foreign_keys_orders.php @@ -0,0 +1,39 @@ +foreign('buyer_id', 'fk_orders_buyer_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('seller_id', 'fk_orders_seller_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('courier_id', 'fk_orders_to_couries')->references('id') + ->on('couriers')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('orders', function (Blueprint $table) { + $table->dropForeign('fk_orders_buyer_to_users'); + $table->dropForeign('fk_orders_buyer_to_users'); + $table->dropForeign('fk_orders_to_couries'); + }); + } +}; diff --git a/database/migrations/2023_03_17_173146_add_foreign_keys_detail_orders.php b/database/migrations/2023_03_17_173146_add_foreign_keys_detail_orders.php new file mode 100644 index 0000000..e15af9e --- /dev/null +++ b/database/migrations/2023_03_17_173146_add_foreign_keys_detail_orders.php @@ -0,0 +1,36 @@ +foreign('order_id', 'fk_detail_orders_to_orders')->references('id') + ->on('orders')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('product_id', 'fk_detail_orders_to_detail_products')->references('id') + ->on('detail_products')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('detail_orders', function (Blueprint $table) { + $table->dropForeign('fk_detail_orders_to_orders'); + $table->dropForeign('fk_detail_orders_to_detail_products'); + }); + } +}; diff --git a/database/migrations/2023_03_17_173225_add_foreign_keys_categories.php b/database/migrations/2023_03_17_173225_add_foreign_keys_categories.php new file mode 100644 index 0000000..b2040ff --- /dev/null +++ b/database/migrations/2023_03_17_173225_add_foreign_keys_categories.php @@ -0,0 +1,33 @@ +foreign('seller_id', 'fk_categories_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('categories', function (Blueprint $table) { + $table->dropForeign('fk_categories_to_users'); + }); + } +}; diff --git a/database/migrations/2023_03_17_173252_add_foreign_keys_reviews.php b/database/migrations/2023_03_17_173252_add_foreign_keys_reviews.php new file mode 100644 index 0000000..6a3112c --- /dev/null +++ b/database/migrations/2023_03_17_173252_add_foreign_keys_reviews.php @@ -0,0 +1,33 @@ +foreign('buyer_id', 'fk_reviews_to_users')->references('id') + ->on('users')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('reviews', function (Blueprint $table) { + $table->dropForeign('fk_reviews_to_users'); + }); + } +}; From a67ee12257af15e286e1c1aadfdac5cc6a073653 Mon Sep 17 00:00:00 2001 From: setyobagus01 <56948098+setyobagus01@users.noreply.github.com> Date: Wed, 22 Mar 2023 02:19:30 +0700 Subject: [PATCH 2/5] add user auth --- app/Http/Controllers/AuthController.php | 103 ++ app/Models/User.php | 2 +- app/Providers/AuthServiceProvider.php | 3 +- composer.json | 1 + composer.lock | 1389 +++++++++++++++-- config/auth.php | 4 + config/firebase.php | 192 +++ config/passport.php | 62 + .../2014_10_12_000000_create_users_table.php | 1 + ...1_000001_create_oauth_auth_codes_table.php | 31 + ...00002_create_oauth_access_tokens_table.php | 33 + ...0003_create_oauth_refresh_tokens_table.php | 29 + ...6_01_000004_create_oauth_clients_table.php | 35 + database/seeders/DatabaseSeeder.php | 4 + database/seeders/UsersTableSeeder.php | 39 + routes/api.php | 8 +- 16 files changed, 1843 insertions(+), 93 deletions(-) create mode 100644 app/Http/Controllers/AuthController.php create mode 100644 config/firebase.php create mode 100644 config/passport.php create mode 100644 database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php create mode 100644 database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php create mode 100644 database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php create mode 100644 database/migrations/2016_06_01_000004_create_oauth_clients_table.php create mode 100644 database/seeders/UsersTableSeeder.php diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php new file mode 100644 index 0000000..5b9a4f7 --- /dev/null +++ b/app/Http/Controllers/AuthController.php @@ -0,0 +1,103 @@ +validate($request, [ + 'name' => 'required|min:4', + 'email' => 'required|email', + 'password' => 'required|min:8', + ]); + + + + $user = User::create([ + 'name' => $request->name, + 'email' => $request->email, + 'password' => bcrypt($request->password) + ]); + + $token = $user->createToken('LaravelAuthApp')->accessToken; + + return response()->json(['token' => $token], 200); + } + + /** + * Login + */ + + public function login(Request $request) + { + + // Launch Firebase Auth + $auth = app('firebase.auth'); + // Retrieve the Firebase credential's token + $idTokenString = $request->input('Firebasetoken'); + + try { // Try to verify the firebase credential token with Google + $verifiedToken = $auth->verifyIdToken($idTokenString); + } catch (\InvalidArgumentException $e) { // If the token has the wrong format + return response()->json( + [ + 'message' => 'Unauthorized - Can\'t parse the token' . $e->getMessage() + ], + 401 + ); + } + + // Retrieve the UID (User ID) from the verified Firebase credential's token + $uid = $verifiedToken->getClaim('sub'); + + // Retrieve the user model linked with the Firebase UID + $user = User::where('firebase_uid', $uid)->first(); + + // Here you could check if the user model exist and if not create it + // For simplicity we will ignore this step + + // Once we got a valid user model + // Create a Personnal Access Token + $tokenResult = $user->createToken('Personal Access Token'); + + // Store the created token + $token = $tokenResult->token; + + // Add a expiration date to the token + $token->expires_at = Carbon::now()->addWeeks(1); + + // Save the token to the user + $token->save(); + + return response()->json([ + "id" => $user->id, + "access_token" => $tokenResult->accessToken, + "token_type" => "Bearer", + 'expires_at' => Carbon::parse($tokenResult->token->expires_at)->toDateTimeString() + ]); + + // $data = [ + // 'email' => $request->email, + // 'password' => $request->password + // ]; + + // if (auth()->attempt($data)) { + // /** @var \App\Models\User $user **/ + // $user = Auth::user(); + // $token = $user->createToken('LaravelAuthApp')->accessToken; + // return response()->json(['token' => $token], 200); + // } else { + // return response()->json(['error' => 'Unauthorised'], 401); + // } + } +} diff --git a/app/Models/User.php b/app/Models/User.php index 8996368..c25d6ab 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; -use Laravel\Sanctum\HasApiTokens; +use Laravel\Passport\HasApiTokens; class User extends Authenticatable { diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 22b77e6..7786481 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -4,6 +4,7 @@ use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Gate; +use Laravel\Passport\Passport; class AuthServiceProvider extends ServiceProvider { @@ -24,7 +25,5 @@ class AuthServiceProvider extends ServiceProvider public function boot() { $this->registerPolicies(); - - // } } diff --git a/composer.json b/composer.json index 933678e..4e211a9 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ "php": "^8.0", "fruitcake/laravel-cors": "^2.0.5", "guzzlehttp/guzzle": "^7.2", + "kreait/laravel-firebase": "^4.2", "laravel/framework": "^9.0", "laravel/passport": "^11.8", "laravel/sanctum": "^2.14", diff --git a/composer.lock b/composer.lock index 2c54ea2..f0cf20d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9607172454f104d1b58fa4069a1173dd", + "content-hash": "bdddf9553f58e1d6c7d56fe8e20649a9", "packages": [ { "name": "asm89/stack-cors", @@ -62,6 +62,124 @@ }, "time": "2022-01-18T09:12:03+00:00" }, + { + "name": "beste/clock", + "version": "2.3.1", + "source": { + "type": "git", + "url": "https://github.com/beste/clock.git", + "reference": "cf2cc16e6670a16fd2defc6d383313de829fa291" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beste/clock/zipball/cf2cc16e6670a16fd2defc6d383313de829fa291", + "reference": "cf2cc16e6670a16fd2defc6d383313de829fa291", + "shasum": "" + }, + "require": { + "php": "^8.0", + "stella-maris/clock": "^0.1.6" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9.1", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.29" + }, + "type": "library", + "autoload": { + "files": [ + "src/Clock.php" + ], + "psr-4": { + "Beste\\Clock\\": "src/Clock" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérôme Gamez", + "email": "jerome@gamez.name" + } + ], + "description": "A collection of Clock implementations", + "keywords": [ + "clock", + "clock-interface", + "psr-20", + "psr20" + ], + "support": { + "issues": "https://github.com/beste/clock/issues", + "source": "https://github.com/beste/clock/tree/2.3.1" + }, + "funding": [ + { + "url": "https://github.com/jeromegamez", + "type": "github" + } + ], + "time": "2022-11-25T18:24:28+00:00" + }, + { + "name": "beste/json", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/beste/json.git", + "reference": "6b02a023ffb0ca92d612ce4f5a3b4c2bd6e17df3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beste/json/zipball/6b02a023ffb0ca92d612ce4f5a3b4c2bd6e17df3", + "reference": "6b02a023ffb0ca92d612ce4f5a3b4c2bd6e17df3", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/Json.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérôme Gamez", + "email": "jerome@gamez.name" + } + ], + "description": "A simple JSON helper to decode and encode JSON", + "support": { + "issues": "https://github.com/beste/json/issues", + "source": "https://github.com/beste/json/tree/1.0.0" + }, + "funding": [ + { + "url": "https://github.com/jeromegamez", + "type": "github" + } + ], + "time": "2022-02-12T21:24:20+00:00" + }, { "name": "brick/math", "version": "0.11.0", @@ -598,6 +716,62 @@ ], "time": "2023-01-02T17:26:14+00:00" }, + { + "name": "fig/http-message-util", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message-util.git", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "suggest": { + "psr/http-message": "The package containing the PSR-7 interfaces" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Fig\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "issues": "https://github.com/php-fig/http-message-util/issues", + "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" + }, + "time": "2020-11-24T22:02:12+00:00" + }, { "name": "firebase/php-jwt", "version": "v6.4.0", @@ -812,6 +986,232 @@ ], "time": "2022-02-20T15:07:15+00:00" }, + { + "name": "google/auth", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-auth-library-php.git", + "reference": "0865c44ab50378f7b145827dfcbd1e7a238f7759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/0865c44ab50378f7b145827dfcbd1e7a238f7759", + "reference": "0865c44ab50378f7b145827dfcbd1e7a238f7759", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^5.5||^6.0", + "guzzlehttp/guzzle": "^6.2.1|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "php": "^7.1||^8.0", + "psr/cache": "^1.0|^2.0|^3.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "guzzlehttp/promises": "0.1.1|^1.3", + "kelvinmo/simplejwt": "^0.2.5|^0.5.1", + "phpseclib/phpseclib": "^2.0.31", + "phpspec/prophecy-phpunit": "^1.1||^2.0", + "phpunit/phpunit": "^7.5||^9.0.0", + "sebastian/comparator": ">=1.2.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "http://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/main/", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.25.0" + }, + "time": "2023-01-26T22:04:14+00:00" + }, + { + "name": "google/cloud-core", + "version": "v1.49.2", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-core.git", + "reference": "18d37b0b9fa761eaff909f360f96efa9ca2d6ca7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/18d37b0b9fa761eaff909f360f96efa9ca2d6ca7", + "reference": "18d37b0b9fa761eaff909f360f96efa9ca2d6ca7", + "shasum": "" + }, + "require": { + "google/auth": "^1.18", + "guzzlehttp/guzzle": "^5.3|^6.5.7|^7.4.4", + "guzzlehttp/promises": "^1.3", + "guzzlehttp/psr7": "^1.7|^2.0", + "monolog/monolog": "^1.1|^2.0|^3.0", + "php": ">=5.6", + "psr/http-message": "1.0.*", + "rize/uri-template": "~0.3" + }, + "require-dev": { + "erusev/parsedown": "^1.6", + "google/cloud-common-protos": "^0.3", + "google/gax": "^1.9", + "opis/closure": "^3", + "phpdocumentor/reflection": "^3.0||^4.0||^5.3", + "phpspec/prophecy": "^1.10.3", + "phpunit/phpunit": "^4.8|^5.0|^8.0", + "squizlabs/php_codesniffer": "2.*", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", + "symfony/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9" + }, + "bin": [ + "bin/google-cloud-batch" + ], + "type": "library", + "extra": { + "component": { + "id": "cloud-core", + "target": "googleapis/google-cloud-php-core.git", + "path": "Core", + "entry": "src/ServiceBuilder.php" + } + }, + "autoload": { + "psr-4": { + "Google\\Cloud\\Core\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.49.2" + }, + "time": "2023-03-10T20:22:17+00:00" + }, + { + "name": "google/cloud-storage", + "version": "v1.30.2", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-storage.git", + "reference": "b7f74ec1b701d56945cbc6c20345e2d21b1b3545" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/b7f74ec1b701d56945cbc6c20345e2d21b1b3545", + "reference": "b7f74ec1b701d56945cbc6c20345e2d21b1b3545", + "shasum": "" + }, + "require": { + "google/cloud-core": "^1.43", + "google/crc32": "^0.1.0" + }, + "require-dev": { + "erusev/parsedown": "^1.6", + "google/cloud-pubsub": "^1.0", + "phpdocumentor/reflection": "^3.0||^4.0", + "phpseclib/phpseclib": "^2.0||^3.0", + "phpspec/prophecy": "^1.10.3", + "phpunit/phpunit": "^4.8|^5.0|^8.0", + "squizlabs/php_codesniffer": "2.*", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "google/cloud-pubsub": "May be used to register a topic to receive bucket notifications.", + "phpseclib/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2." + }, + "type": "library", + "extra": { + "component": { + "id": "cloud-storage", + "target": "googleapis/google-cloud-php-storage.git", + "path": "Storage", + "entry": "src/StorageClient.php" + } + }, + "autoload": { + "psr-4": { + "Google\\Cloud\\Storage\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Cloud Storage Client for PHP", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.30.2" + }, + "time": "2023-01-27T18:26:22+00:00" + }, + { + "name": "google/crc32", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/google/php-crc32.git", + "reference": "a8525f0dea6fca1893e1bae2f6e804c5f7d007fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/google/php-crc32/zipball/a8525f0dea6fca1893e1bae2f6e804c5f7d007fb", + "reference": "a8525f0dea6fca1893e1bae2f6e804c5f7d007fb", + "shasum": "" + }, + "require": { + "php": ">=5.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^1.13 || v2.14.2", + "paragonie/random_compat": ">=2", + "phpunit/phpunit": "^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\CRC32\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Andrew Brampton", + "email": "bramp@google.com" + } + ], + "description": "Various CRC32 implementations", + "homepage": "https://github.com/google/php-crc32", + "support": { + "issues": "https://github.com/google/php-crc32/issues", + "source": "https://github.com/google/php-crc32/tree/v0.1.0" + }, + "time": "2019-05-09T06:24:58+00:00" + }, { "name": "graham-campbell/result-type", "version": "v1.1.1", @@ -1289,6 +1689,266 @@ ], "time": "2021-10-07T12:57:01+00:00" }, + { + "name": "kreait/firebase-php", + "version": "6.9.5", + "source": { + "type": "git", + "url": "https://github.com/kreait/firebase-php.git", + "reference": "e64ce87a2d3be0acef91c33aea6269bbd528b12f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kreait/firebase-php/zipball/e64ce87a2d3be0acef91c33aea6269bbd528b12f", + "reference": "e64ce87a2d3be0acef91c33aea6269bbd528b12f", + "shasum": "" + }, + "require": { + "beste/clock": "^2.1", + "beste/json": "^1.0", + "ext-ctype": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "fig/http-message-util": "^1.1", + "google/auth": "^1.21", + "google/cloud-core": "^1.44.2", + "google/cloud-storage": "^1.26.2", + "guzzlehttp/guzzle": "^7.4.5", + "kreait/firebase-tokens": "^3.0", + "lcobucci/jwt": "^4.1", + "mtdowling/jmespath.php": "^2.6.1", + "php": "^7.4|^8.0", + "psr/cache": "^1.0.1|^2.0|^3.0", + "psr/http-message": "^1.0.1", + "psr/log": "^1.1|^2.0|^3.0", + "riverline/multipart-parser": "^2.0.8", + "symfony/polyfill-php80": "^1.23", + "symfony/polyfill-php81": "^1.23" + }, + "require-dev": { + "google/cloud-firestore": "^1.25.1", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8.2", + "phpstan/phpstan-phpunit": "^1.1.1", + "phpunit/phpunit": "^9.5.22", + "symfony/var-dumper": "^5.4|^6.1.3" + }, + "suggest": { + "google/cloud-firestore": "^1.0 to use the Firestore component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-7.x": "7.x-dev", + "dev-6.x": "6.x-dev", + "dev-5.x": "5.x-dev", + "dev-4.x": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Kreait\\Firebase\\": "src/Firebase" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérôme Gamez", + "homepage": "https://github.com/jeromegamez" + } + ], + "description": "Firebase Admin SDK", + "homepage": "https://github.com/kreait/firebase-php", + "keywords": [ + "api", + "database", + "firebase", + "google", + "sdk" + ], + "support": { + "docs": "https://firebase-php.readthedocs.io", + "issues": "https://github.com/kreait/firebase-php/issues", + "source": "https://github.com/kreait/firebase-php" + }, + "funding": [ + { + "url": "https://github.com/sponsors/jeromegamez", + "type": "github" + } + ], + "time": "2023-01-27T09:30:40+00:00" + }, + { + "name": "kreait/firebase-tokens", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/kreait/firebase-tokens-php.git", + "reference": "3f732ae04f6548f5130709daf06fcc1ca0561002" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kreait/firebase-tokens-php/zipball/3f732ae04f6548f5130709daf06fcc1ca0561002", + "reference": "3f732ae04f6548f5130709daf06fcc1ca0561002", + "shasum": "" + }, + "require": { + "beste/clock": "^2.0", + "ext-json": "*", + "ext-openssl": "*", + "fig/http-message-util": "^1.1.5", + "guzzlehttp/guzzle": "^7.4.5", + "lcobucci/jwt": "^4.1.5", + "php": "^7.4|^8.0", + "psr/cache": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.4", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5.10", + "rector/rector": "^0.12.9", + "symfony/cache": "^5.4|^6.0", + "symfony/var-dumper": "^5.3|^6.0" + }, + "suggest": { + "psr/cache-implementation": "to cache fetched remote public keys" + }, + "type": "library", + "autoload": { + "psr-4": { + "Kreait\\Firebase\\JWT\\": "src/JWT" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérôme Gamez", + "homepage": "https://github.com/jeromegamez" + } + ], + "description": "A library to work with Firebase tokens", + "homepage": "https://github.com/kreait/firebase-token-php", + "keywords": [ + "Authentication", + "auth", + "firebase", + "google", + "token" + ], + "support": { + "issues": "https://github.com/kreait/firebase-tokens-php/issues", + "source": "https://github.com/kreait/firebase-tokens-php/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sponsors/jeromegamez", + "type": "github" + } + ], + "time": "2022-08-22T21:40:00+00:00" + }, + { + "name": "kreait/laravel-firebase", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/kreait/laravel-firebase.git", + "reference": "35bdebd32cde14735e4edaa13d6684becf6607b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kreait/laravel-firebase/zipball/35bdebd32cde14735e4edaa13d6684becf6607b4", + "reference": "35bdebd32cde14735e4edaa13d6684becf6607b4", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0 || ^9.0", + "illuminate/support": "^8.0 || ^9.0", + "kreait/firebase-php": "^6.7", + "php": "^7.4 || ^8.0", + "symfony/cache": "^5.4 || ^6.1.2" + }, + "require-dev": { + "orchestra/testbench": "^6.0 || 7.0", + "symplify/easy-coding-standard": "^10.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + }, + "laravel": { + "providers": [ + "Kreait\\Laravel\\Firebase\\ServiceProvider" + ], + "aliases": { + "Firebase": "Kreait\\Laravel\\Firebase\\Facades\\Firebase" + } + } + }, + "autoload": { + "psr-4": { + "Kreait\\Laravel\\Firebase\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérôme Gamez", + "email": "jerome@gamez.name" + } + ], + "description": "A Laravel package for the Firebase PHP Admin SDK", + "keywords": [ + "FCM", + "api", + "database", + "firebase", + "gcm", + "laravel", + "sdk" + ], + "support": { + "issues": "https://github.com/kreait/laravel-firebase/issues", + "source": "https://github.com/kreait/laravel-firebase/tree/4.2.0" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/jeromegamez", + "type": "custom" + }, + { + "url": "https://www.paypal.me/jeromegamez", + "type": "custom" + }, + { + "url": "https://github.com/jeromegamez", + "type": "github" + }, + { + "url": "https://ko-fi.com/jeromegamez", + "type": "ko_fi" + }, + { + "url": "https://www.patreon.com/jeromegamez", + "type": "patreon" + } + ], + "time": "2022-07-28T18:03:37+00:00" + }, { "name": "laravel/framework", "version": "v9.52.4", @@ -1821,43 +2481,41 @@ }, { "name": "lcobucci/jwt", - "version": "4.0.4", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "55564265fddf810504110bd68ca311932324b0e9" + "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/55564265fddf810504110bd68ca311932324b0e9", - "reference": "55564265fddf810504110bd68ca311932324b0e9", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/4d7de2fe0d51a96418c0d04004986e410e87f6b4", + "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4", "shasum": "" }, "require": { + "ext-hash": "*", + "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "lcobucci/clock": "^2.0", + "ext-sodium": "*", + "lcobucci/clock": "^2.0 || ^3.0", "php": "^7.4 || ^8.0" }, "require-dev": { - "infection/infection": "^0.20", + "infection/infection": "^0.21", "lcobucci/coding-standard": "^6.0", - "mikey179/vfsstream": "^1.6", - "phpbench/phpbench": "^0.17", + "mikey179/vfsstream": "^1.6.7", + "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", "phpunit/php-invoker": "^3.1", - "phpunit/phpunit": "^9.4" + "phpunit/phpunit": "^9.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, "autoload": { "psr-4": { "Lcobucci\\JWT\\": "src" @@ -1881,7 +2539,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/4.0.4" + "source": "https://github.com/lcobucci/jwt/tree/4.3.0" }, "funding": [ { @@ -1893,7 +2551,7 @@ "type": "patreon" } ], - "time": "2021-09-28T19:18:28+00:00" + "time": "2023-01-02T13:28:00+00:00" }, { "name": "league/commonmark", @@ -2642,7 +3300,68 @@ "type": "tidelift" } ], - "time": "2023-02-06T13:44:46+00:00" + "time": "2023-02-06T13:44:46+00:00" + }, + { + "name": "mtdowling/jmespath.php", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" + }, + "require-dev": { + "composer/xdebug-handler": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^7.5.15" + }, + "bin": [ + "bin/jp.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "files": [ + "src/JmesPath.php" + ], + "psr-4": { + "JmesPath\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Declaratively specify how to extract elements from a JSON document", + "keywords": [ + "json", + "jsonpath" + ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1" + }, + "time": "2021-06-14T00:11:39+00:00" }, { "name": "nesbot/carbon", @@ -3470,6 +4189,55 @@ ], "time": "2023-03-05T17:13:09+00:00" }, + { + "name": "psr/cache", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/2.0.0" + }, + "time": "2021-02-03T23:23:37+00:00" + }, { "name": "psr/clock", "version": "1.0.0", @@ -4116,97 +4884,371 @@ "rhumsaa/uuid": "self.version" }, "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "default-branch": true, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.x" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2023-02-07T16:14:23+00:00" + }, + { + "name": "riverline/multipart-parser", + "version": "2.0.9", + "source": { + "type": "git", + "url": "https://github.com/Riverline/multipart-parser.git", + "reference": "ebba10245b5a6e03a673ff52c547d05029caedab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Riverline/multipart-parser/zipball/ebba10245b5a6e03a673ff52c547d05029caedab", + "reference": "ebba10245b5a6e03a673ff52c547d05029caedab", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "laminas/laminas-diactoros": "^1.8.7", + "phpunit/phpunit": "^5.2 || ^6.0 || ^7.0", + "psr/http-message": "^1.0", + "symfony/psr-http-message-bridge": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Riverline\\MultiPartParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Romain Cambien", + "email": "romain@cambien.net" + }, + { + "name": "Riverline", + "homepage": "http://www.riverline.fr" + } + ], + "description": "One class library to parse multipart content with encoding and charset support.", + "keywords": [ + "http", + "multipart", + "parser" + ], + "support": { + "issues": "https://github.com/Riverline/multipart-parser/issues", + "source": "https://github.com/Riverline/multipart-parser/tree/2.0.9" + }, + "time": "2021-10-18T09:56:35+00:00" + }, + { + "name": "rize/uri-template", + "version": "0.3.5", + "source": { + "type": "git", + "url": "https://github.com/rize/UriTemplate.git", + "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rize/UriTemplate/zipball/5ed4ba8ea34af84485dea815d4b6b620794d1168", + "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "Rize\\": "src/Rize" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marut K", + "homepage": "http://twitter.com/rezigned" + } + ], + "description": "PHP URI Template (RFC 6570) supports both expansion & extraction", + "keywords": [ + "RFC 6570", + "template", + "uri" + ], + "support": { + "issues": "https://github.com/rize/UriTemplate/issues", + "source": "https://github.com/rize/UriTemplate/tree/0.3.5" + }, + "funding": [ + { + "url": "https://www.paypal.me/rezigned", + "type": "custom" + }, + { + "url": "https://github.com/rezigned", + "type": "github" + }, + { + "url": "https://opencollective.com/rize-uri-template", + "type": "open_collective" + } + ], + "time": "2022-10-12T17:22:51+00:00" + }, + { + "name": "stella-maris/clock", + "version": "0.1.7", + "source": { + "type": "git", + "url": "https://github.com/stella-maris-solutions/clock.git", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/fa23ce16019289a18bb3446fdecd45befcdd94f8", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "psr/clock": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "StellaMaris\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Heigl", + "role": "Maintainer" + } + ], + "description": "A pre-release of the proposed PSR-20 Clock-Interface", + "homepage": "https://gitlab.com/stella-maris/clock", + "keywords": [ + "clock", + "datetime", + "point in time", + "psr20" + ], + "support": { + "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.7" + }, + "time": "2022-11-25T16:15:06+00:00" + }, + { + "name": "symfony/cache", + "version": "v5.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "32cab695bf99c63aff7d27ac67919944c00530ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/32cab695bf99c63aff7d27ac67919944c00530ed", + "reference": "32cab695bf99c63aff7d27ac67919944c00530ed", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "conflict": { + "doctrine/dbal": "<2.13.1", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0|2.0", + "symfony/cache-implementation": "1.0|2.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6|^2.0", + "doctrine/dbal": "^2.13.1|^3.0", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0|^2.0", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, - "default-branch": true, "type": "library", - "extra": { - "captainhook": { - "force-install": true - } - }, "autoload": { - "files": [ - "src/functions.php" - ], "psr-4": { - "Ramsey\\Uuid\\": "src/" - } + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", "keywords": [ - "guid", - "identifier", - "uuid" + "caching", + "psr6" ], "support": { - "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.x" + "source": "https://github.com/symfony/cache/tree/v5.4.21" }, "funding": [ { - "url": "https://github.com/ramsey", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-02-07T16:14:23+00:00" + "time": "2023-02-21T12:11:13+00:00" }, { - "name": "stella-maris/clock", - "version": "0.1.7", + "name": "symfony/cache-contracts", + "version": "v2.5.2", "source": { "type": "git", - "url": "https://github.com/stella-maris-solutions/clock.git", - "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8" + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/fa23ce16019289a18bb3446fdecd45befcdd94f8", - "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", + "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", "shasum": "" }, "require": { - "php": "^7.0|^8.0", - "psr/clock": "^1.0" + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0|^3.0" + }, + "suggest": { + "symfony/cache-implementation": "" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, "autoload": { "psr-4": { - "StellaMaris\\Clock\\": "src" + "Symfony\\Contracts\\Cache\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4215,22 +5257,42 @@ ], "authors": [ { - "name": "Andreas Heigl", - "role": "Maintainer" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A pre-release of the proposed PSR-20 Clock-Interface", - "homepage": "https://gitlab.com/stella-maris/clock", + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", "keywords": [ - "clock", - "datetime", - "point in time", - "psr20" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.7" + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" }, - "time": "2022-11-25T16:15:06+00:00" + "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": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/console", @@ -5586,6 +6648,85 @@ ], "time": "2022-11-03T14:55:06+00:00" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "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 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.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": "2022-11-03T14:55:06+00:00" + }, { "name": "symfony/polyfill-php80", "version": "v1.27.0", @@ -6569,6 +7710,78 @@ ], "time": "2023-01-20T17:44:14+00:00" }, + { + "name": "symfony/var-exporter", + "version": "v6.0.19", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", + "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "require-dev": { + "symfony/var-dumper": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v6.0.19" + }, + "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-01-13T08:34:10+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "2.2.6", diff --git a/config/auth.php b/config/auth.php index d8c6cee..85fd15b 100644 --- a/config/auth.php +++ b/config/auth.php @@ -40,6 +40,10 @@ 'driver' => 'session', 'provider' => 'users', ], + 'api' => [ + 'driver' => 'passport', + 'provider' => 'users', + ], ], /* diff --git a/config/firebase.php b/config/firebase.php new file mode 100644 index 0000000..02b495a --- /dev/null +++ b/config/firebase.php @@ -0,0 +1,192 @@ + env('FIREBASE_PROJECT', 'app'), + + /* + * ------------------------------------------------------------------------ + * Firebase project configurations + * ------------------------------------------------------------------------ + */ + 'projects' => [ + 'app' => [ + /* + * ------------------------------------------------------------------------ + * Credentials / Service Account + * ------------------------------------------------------------------------ + * + * In order to access a Firebase project and its related services using a + * server SDK, requests must be authenticated. For server-to-server + * communication this is done with a Service Account. + * + * If you don't already have generated a Service Account, you can do so by + * following the instructions from the official documentation pages at + * + * https://firebase.google.com/docs/admin/setup#initialize_the_sdk + * + * Once you have downloaded the Service Account JSON file, you can use it + * to configure the package. + * + * If you don't provide credentials, the Firebase Admin SDK will try to + * auto-discover them + * + * - by checking the environment variable FIREBASE_CREDENTIALS + * - by checking the environment variable GOOGLE_APPLICATION_CREDENTIALS + * - by trying to find Google's well known file + * - by checking if the application is running on GCE/GCP + * + * If no credentials file can be found, an exception will be thrown the + * first time you try to access a component of the Firebase Admin SDK. + * + */ + 'credentials' => [ + 'file' => env('FIREBASE_CREDENTIALS', env('GOOGLE_APPLICATION_CREDENTIALS')), + + /* + * If you want to prevent the auto discovery of credentials, set the + * following parameter to false. If you disable it, you must + * provide a credentials file. + */ + 'auto_discovery' => true, + ], + + /* + * ------------------------------------------------------------------------ + * Firebase Auth Component + * ------------------------------------------------------------------------ + */ + + 'auth' => [ + 'tenant_id' => env('FIREBASE_AUTH_TENANT_ID'), + ], + + /* + * ------------------------------------------------------------------------ + * Firebase Realtime Database + * ------------------------------------------------------------------------ + */ + + 'database' => [ + /* + * In most of the cases the project ID defined in the credentials file + * determines the URL of your project's Realtime Database. If the + * connection to the Realtime Database fails, you can override + * its URL with the value you see at + * + * https://console.firebase.google.com/u/1/project/_/database + * + * Please make sure that you use a full URL like, for example, + * https://my-project-id.firebaseio.com + */ + 'url' => env('FIREBASE_DATABASE_URL'), + + /* + * As a best practice, a service should have access to only the resources it needs. + * To get more fine-grained control over the resources a Firebase app instance can access, + * use a unique identifier in your Security Rules to represent your service. + * + * https://firebase.google.com/docs/database/admin/start#authenticate-with-limited-privileges + */ + // 'auth_variable_override' => [ + // 'uid' => 'my-service-worker' + // ], + ], + + 'dynamic_links' => [ + /* + * Dynamic links can be built with any URL prefix registered on + * + * https://console.firebase.google.com/u/1/project/_/durablelinks/links/ + * + * You can define one of those domains as the default for new Dynamic + * Links created within your project. + * + * The value must be a valid domain, for example, + * https://example.page.link + */ + 'default_domain' => env('FIREBASE_DYNAMIC_LINKS_DEFAULT_DOMAIN'), + ], + + /* + * ------------------------------------------------------------------------ + * Firebase Cloud Storage + * ------------------------------------------------------------------------ + */ + + 'storage' => [ + /* + * Your project's default storage bucket usually uses the project ID + * as its name. If you have multiple storage buckets and want to + * use another one as the default for your application, you can + * override it here. + */ + + 'default_bucket' => env('FIREBASE_STORAGE_DEFAULT_BUCKET'), + ], + + /* + * ------------------------------------------------------------------------ + * Caching + * ------------------------------------------------------------------------ + * + * The Firebase Admin SDK can cache some data returned from the Firebase + * API, for example Google's public keys used to verify ID tokens. + * + */ + + 'cache_store' => env('FIREBASE_CACHE_STORE', 'file'), + + /* + * ------------------------------------------------------------------------ + * Logging + * ------------------------------------------------------------------------ + * + * Enable logging of HTTP interaction for insights and/or debugging. + * + * Log channels are defined in config/logging.php + * + * Successful HTTP messages are logged with the log level 'info'. + * Failed HTTP messages are logged with the the log level 'notice'. + * + * Note: Using the same channel for simple and debug logs will result in + * two entries per request and response. + */ + + 'logging' => [ + 'http_log_channel' => env('FIREBASE_HTTP_LOG_CHANNEL'), + 'http_debug_log_channel' => env('FIREBASE_HTTP_DEBUG_LOG_CHANNEL'), + ], + + /* + * ------------------------------------------------------------------------ + * HTTP Client Options + * ------------------------------------------------------------------------ + * + * Behavior of the HTTP Client performing the API requests + */ + 'http_client_options' => [ + /* + * Use a proxy that all API requests should be passed through. + * (default: none) + */ + 'proxy' => env('FIREBASE_HTTP_CLIENT_PROXY'), + + /* + * Set the maximum amount of seconds (float) that can pass before + * a request is considered timed out + * + * The default time out can be reviewed at + * https://github.com/kreait/firebase-php/blob/6.x/src/Firebase/Http/HttpClientOptions.php + */ + 'timeout' => env('FIREBASE_HTTP_CLIENT_TIMEOUT'), + ], + ], + ], +]; diff --git a/config/passport.php b/config/passport.php new file mode 100644 index 0000000..9aa5fe8 --- /dev/null +++ b/config/passport.php @@ -0,0 +1,62 @@ + 'web', + + /* + |-------------------------------------------------------------------------- + | Encryption Keys + |-------------------------------------------------------------------------- + | + | Passport uses encryption keys while generating secure access tokens for + | your application. By default, the keys are stored as local files but + | can be set via environment variables when that is more convenient. + | + */ + + 'private_key' => env('PASSPORT_PRIVATE_KEY'), + + 'public_key' => env('PASSPORT_PUBLIC_KEY'), + + /* + |-------------------------------------------------------------------------- + | Client UUIDs + |-------------------------------------------------------------------------- + | + | By default, Passport uses auto-incrementing primary keys when assigning + | IDs to clients. However, if Passport is installed using the provided + | --uuids switch, this will be set to "true" and UUIDs will be used. + | + */ + + 'client_uuids' => true, + + /* + |-------------------------------------------------------------------------- + | Personal Access Client + |-------------------------------------------------------------------------- + | + | If you enable client hashing, you should set the personal access client + | ID and unhashed secret within your environment file. The values will + | get used while issuing fresh personal access tokens to your users. + | + */ + + 'personal_access_client' => [ + 'id' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_ID'), + 'secret' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET'), + ], + +]; diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 374f804..65cc327 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -19,6 +19,7 @@ public function up() $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); + $table->string('firebase_uid'); $table->rememberToken(); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php b/database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php new file mode 100644 index 0000000..247a167 --- /dev/null +++ b/database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php @@ -0,0 +1,31 @@ +string('id', 100)->primary(); + $table->unsignedBigInteger('user_id')->index(); + $table->uuid('client_id'); + $table->text('scopes')->nullable(); + $table->boolean('revoked'); + $table->dateTime('expires_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('oauth_auth_codes'); + } +}; diff --git a/database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php b/database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php new file mode 100644 index 0000000..eef9c33 --- /dev/null +++ b/database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php @@ -0,0 +1,33 @@ +string('id', 100)->primary(); + $table->unsignedBigInteger('user_id')->nullable()->index(); + $table->uuid('client_id'); + $table->string('name')->nullable(); + $table->text('scopes')->nullable(); + $table->boolean('revoked'); + $table->timestamps(); + $table->dateTime('expires_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('oauth_access_tokens'); + } +}; diff --git a/database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php b/database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php new file mode 100644 index 0000000..b007904 --- /dev/null +++ b/database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php @@ -0,0 +1,29 @@ +string('id', 100)->primary(); + $table->string('access_token_id', 100)->index(); + $table->boolean('revoked'); + $table->dateTime('expires_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('oauth_refresh_tokens'); + } +}; diff --git a/database/migrations/2016_06_01_000004_create_oauth_clients_table.php b/database/migrations/2016_06_01_000004_create_oauth_clients_table.php new file mode 100644 index 0000000..8e437ea --- /dev/null +++ b/database/migrations/2016_06_01_000004_create_oauth_clients_table.php @@ -0,0 +1,35 @@ +uuid('id')->primary(); + $table->unsignedBigInteger('user_id')->nullable()->index(); + $table->string('name'); + $table->string('secret', 100)->nullable(); + $table->string('provider')->nullable(); + $table->text('redirect'); + $table->boolean('personal_access_client'); + $table->boolean('password_client'); + $table->boolean('revoked'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('oauth_clients'); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 71f673f..45d84a4 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,5 +15,9 @@ class DatabaseSeeder extends Seeder public function run() { // \App\Models\User::factory(10)->create(); + $this->call([ + UsersTableSeeder::class, + CategoriesTableSeeder::class + ]); } } diff --git a/database/seeders/UsersTableSeeder.php b/database/seeders/UsersTableSeeder.php new file mode 100644 index 0000000..a9ccdac --- /dev/null +++ b/database/seeders/UsersTableSeeder.php @@ -0,0 +1,39 @@ + 'John Doe', + 'email' => 'john@mail.com', + 'password' => Hash::make('Admin@12345'), + 'remember_token' => NULL, + 'created_at' => date('Y-m-d h:i:s'), + 'updated_at' => date('Y-m-d h:i:s'), + ], + [ + 'name' => 'John Doe', + 'email' => 'jane@mail.com', + 'password' => Hash::make('Admin@12345'), + 'remember_token' => NULL, + 'created_at' => date('Y-m-d h:i:s'), + 'updated_at' => date('Y-m-d h:i:s'), + ], + ]; + User::insert($users); + } +} diff --git a/routes/api.php b/routes/api.php index eb6fa48..3a82e5f 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,5 +1,7 @@ get('/user', function (Request $request) { - return $request->user(); + +Route::post('register', [AuthController::class, 'register']); +Route::post('login', [AuthController::class, 'login']); +Route::middleware('auth:api')->group(function () { }); From 7155c77dee40d4028041f2b4fc25e16cc1597e50 Mon Sep 17 00:00:00 2001 From: setyobagus01 <56948098+setyobagus01@users.noreply.github.com> Date: Wed, 22 Mar 2023 02:26:06 +0700 Subject: [PATCH 3/5] add oath migration --- ...te_oauth_personal_access_clients_table.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php diff --git a/database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php b/database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php new file mode 100644 index 0000000..15398c9 --- /dev/null +++ b/database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php @@ -0,0 +1,28 @@ +bigIncrements('id'); + $table->uuid('client_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('oauth_personal_access_clients'); + } +}; From 93b6aa8efca32c75c427789722f4f7534c0bf8fc Mon Sep 17 00:00:00 2001 From: setyobagus01 <56948098+setyobagus01@users.noreply.github.com> Date: Wed, 22 Mar 2023 02:27:24 +0700 Subject: [PATCH 4/5] addition: products crud --- app/Http/Controllers/ProductController.php | 63 +++++++++++++++++++--- app/Http/Requests/ProductStoreRequest.php | 50 +++++++++++++++++ app/Http/Resources/ApiResource.php | 33 ++++++++++++ app/Models/DetailProduct.php | 16 +++++- app/Models/Product.php | 13 ++++- database/seeders/CategoriesTableSeeder.php | 35 ++++++++++++ routes/api.php | 3 ++ 7 files changed, 204 insertions(+), 9 deletions(-) create mode 100644 app/Http/Requests/ProductStoreRequest.php create mode 100644 app/Http/Resources/ApiResource.php create mode 100644 database/seeders/CategoriesTableSeeder.php diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index c4e2ffb..4b603d8 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -2,7 +2,13 @@ namespace App\Http\Controllers; +use App\Http\Requests\ProductStoreRequest; +use App\Http\Resources\ApiResource; +use App\Models\DetailProduct; +use App\Models\Product; use Illuminate\Http\Request; +use Illuminate\Support\Facades\DB; +use Throwable; class ProductController extends Controller { @@ -13,18 +19,37 @@ class ProductController extends Controller */ public function index() { - // + return new ApiResource(true, 'Product list.', Product::with('detail_products')->get()); } + + + /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function store(Request $request) + public function store(ProductStoreRequest $request) { - // + $input = $request->all(); + try { + DB::beginTransaction(); + $product = Product::create([ + 'seller_id' => $input['seller_id'], + 'category_id' => $input['category_id'], + 'name' => $input['name'], + 'description' => $input['description'], + ]); + + $product->detail_products()->createMany($input['details']); + + DB::commit(); + return new ApiResource(true, 'Product has been added.', Product::with('detail_products')->find($product->id)); + } catch (Throwable $e) { + return response()->json(['messages' => $e->getMessage()]); + } } /** @@ -35,7 +60,7 @@ public function store(Request $request) */ public function show($id) { - // + return new ApiResource(true, 'Get specific product.', Product::with('detail_products')->find($id)); } /** @@ -45,9 +70,29 @@ public function show($id) * @param int $id * @return \Illuminate\Http\Response */ - public function update(Request $request, $id) + public function update(ProductStoreRequest $request, $id) { - // + $input = $request->all(); + try { + DB::beginTransaction(); + $product = Product::with('detail_products')->find($id); + $product->update([ + 'seller_id' => $input['seller_id'], + 'category_id' => $input['category_id'], + 'name' => $input['name'], + 'description' => $input['description'], + ]); + foreach ($input['details'] as $detail) { + $product->detail_products()->updateOrCreate($detail); + } + + + DB::commit(); + return new ApiResource(true, $product->id . ' is updated', $product); + } catch (\Throwable $e) { + DB::rollBack(); + return response()->json(['messages' => 'Something went wrong :' . $e->getMessage()]); + } } /** @@ -58,6 +103,10 @@ public function update(Request $request, $id) */ public function destroy($id) { - // + $product = Product::find($id); + $product->detail_products()->delete(); + $product->delete(); + + return new ApiResource(true, 'Product deleted', null); } } diff --git a/app/Http/Requests/ProductStoreRequest.php b/app/Http/Requests/ProductStoreRequest.php new file mode 100644 index 0000000..d86dd14 --- /dev/null +++ b/app/Http/Requests/ProductStoreRequest.php @@ -0,0 +1,50 @@ + 'The :attribute must have value atleast :min', + 'max' => 'The :attribute is not more than :max', + ]; + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return [ + 'seller_id' => 'required|integer', + 'category_id' => 'required|integer', + 'name' => 'required|string|max:255', + 'description' => 'required|string|min:250', + 'details' => 'required|array', + 'details.*.variant' => 'required|string', + 'details.*.sku' => 'required|string', + 'details.*.quantity' => 'required|integer|min:1', + 'details.*.baseprice' => 'required|integer|min:0', + 'details.*.het' => 'required|integer|min:0', + 'details.*.weight' => 'required|numeric', + 'details.*.unit' => 'required|string', + + ]; + } +} diff --git a/app/Http/Resources/ApiResource.php b/app/Http/Resources/ApiResource.php new file mode 100644 index 0000000..2a9b519 --- /dev/null +++ b/app/Http/Resources/ApiResource.php @@ -0,0 +1,33 @@ +status = $status; + $this->message = $message; + } + /** + * Transform the resource into an array. + * + * @param \Illuminate\Http\Request $request + * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + */ + + public function toArray($request) + { + return [ + 'status' => $this->status, + 'message' => $this->message, + 'data' => $this->resource + ]; + } +} diff --git a/app/Models/DetailProduct.php b/app/Models/DetailProduct.php index 0caa3ba..9a0b44a 100644 --- a/app/Models/DetailProduct.php +++ b/app/Models/DetailProduct.php @@ -4,8 +4,22 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class DetailProduct extends Model { - use HasFactory; + use SoftDeletes; + + protected $table = 'detail_products'; + + protected $guarded = ['id']; + + protected $attributes = [ + 'variant' => 'default', + ]; + + public function product() + { + return $this->belongsTo(Product::class, 'product_id', 'id'); + } } diff --git a/app/Models/Product.php b/app/Models/Product.php index c428a88..7becf1d 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -4,8 +4,19 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class Product extends Model { - use HasFactory; + use SoftDeletes; + + protected $table = 'products'; + + + protected $guarded = ['id']; + + public function detail_products() + { + return $this->hasMany(DetailProduct::class, 'product_id'); + } } diff --git a/database/seeders/CategoriesTableSeeder.php b/database/seeders/CategoriesTableSeeder.php new file mode 100644 index 0000000..07b80a6 --- /dev/null +++ b/database/seeders/CategoriesTableSeeder.php @@ -0,0 +1,35 @@ + 1, + 'name' => 'Komputer', + 'created_at' => date('Y-m-d h:i:s'), + 'updated_at' => date('Y-m-d h:i:s'), + ], + [ + 'seller_id' => 1, + 'name' => 'Pakaian', + 'created_at' => date('Y-m-d h:i:s'), + 'updated_at' => date('Y-m-d h:i:s'), + ] + ]; + + Category::insert($categories); + } +} diff --git a/routes/api.php b/routes/api.php index 3a82e5f..a910b86 100644 --- a/routes/api.php +++ b/routes/api.php @@ -21,3 +21,6 @@ Route::post('login', [AuthController::class, 'login']); Route::middleware('auth:api')->group(function () { }); + + +Route::apiResource('products', ProductController::class); From 79a37e929b2f591e7d32e97fe22a81a5588dc476 Mon Sep 17 00:00:00 2001 From: setyobagus01 <56948098+setyobagus01@users.noreply.github.com> Date: Wed, 22 Mar 2023 03:07:08 +0700 Subject: [PATCH 5/5] addition: add categories --- app/Http/Controllers/CategoryController.php | 50 ++++++++++++++++++--- app/Http/Requests/CategoryStoreRequest.php | 30 +++++++++++++ app/Models/Category.php | 12 ++++- app/Models/Product.php | 5 +++ routes/api.php | 4 ++ 5 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 app/Http/Requests/CategoryStoreRequest.php diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 30567a1..48672cc 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -2,7 +2,11 @@ namespace App\Http\Controllers; +use App\Http\Requests\CategoryStoreRequest; +use App\Http\Resources\ApiResource; +use App\Models\Category; use Illuminate\Http\Request; +use Illuminate\Support\Facades\DB; class CategoryController extends Controller { @@ -13,7 +17,7 @@ class CategoryController extends Controller */ public function index() { - // + return new ApiResource(true, 'Show categories.', Category::get()); } /** @@ -22,9 +26,18 @@ public function index() * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function store(Request $request) + public function store(CategoryStoreRequest $request) { - // + $input = $request->all(); + try { + DB::beginTransaction(); + $category = Category::create($input); + DB::commit(); + return new ApiResource(true, 'Category has been created', $category); + } catch (\Throwable $e) { + DB::rollBack(); + return response()->json(['messages' => 'Something went wrong ' . $e->getMessage()]); + } } /** @@ -35,7 +48,20 @@ public function store(Request $request) */ public function show($id) { - // + return new ApiResource(true, 'Show specific category', Category::find($id)); + } + + /** + * Display products by category + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function productsByCategory($id) + { + $category = Category::with('products')->find($id); + $products = $category->products()->get(); + return new ApiResource(true, 'Show products by category', $products); } /** @@ -47,7 +73,17 @@ public function show($id) */ public function update(Request $request, $id) { - // + $input = $request->all(); + try { + DB::beginTransaction(); + $category = Category::find($id); + $category->update($input); + DB::commit(); + return new ApiResource(true, 'Category has been updated', $category); + } catch (\Throwable $e) { + DB::rollBack(); + return response()->json(['messages' => 'Something went wrong ' . $e->getMessage()]); + } } /** @@ -58,6 +94,8 @@ public function update(Request $request, $id) */ public function destroy($id) { - // + $category = Category::find($id); + $category->delete(); + return new ApiResource(true, 'Category has been deleted.', null); } } diff --git a/app/Http/Requests/CategoryStoreRequest.php b/app/Http/Requests/CategoryStoreRequest.php new file mode 100644 index 0000000..adaa950 --- /dev/null +++ b/app/Http/Requests/CategoryStoreRequest.php @@ -0,0 +1,30 @@ + + */ + public function rules() + { + return [ + 'name' => 'required|string' + ]; + } +} diff --git a/app/Models/Category.php b/app/Models/Category.php index c9d6222..605df2f 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -2,10 +2,18 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class Category extends Model { - use HasFactory; + use SoftDeletes; + protected $table = 'categories'; + + protected $guarded = ['id']; + + public function products() + { + return $this->hasMany(Product::class, 'category_id'); + } } diff --git a/app/Models/Product.php b/app/Models/Product.php index 7becf1d..a82461c 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -19,4 +19,9 @@ public function detail_products() { return $this->hasMany(DetailProduct::class, 'product_id'); } + + public function category() + { + return $this->belongsTo(Category::class, 'category_id', 'id'); + } } diff --git a/routes/api.php b/routes/api.php index a910b86..02759e5 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,6 +1,7 @@