From d4cea0228abf7168c9872257f1ba0825f81c0bcf Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 23 Aug 2023 20:55:55 -0700 Subject: [PATCH 01/18] re-organizing the repo structure to add Docker / devcontainer .devcontainer directory and LEMP container(s) added, but the setup for Laravel is not yet working. There are issues with setting up PHP and NGINX to serve only /public/ on the homepage of localhost --- .../.docker/nginx/conf.d/error_reporting.ini | 1 + .devcontainer/.docker/nginx/conf.d/php.conf | 14 ++++ .devcontainer/.docker/php/Dockerfile | 54 ++++++++++++++ .devcontainer/.docker/php/docker-php.ini | 1 + .devcontainer/.docker/php/xdebug.ini | 11 +++ .devcontainer/.env | 25 +++++++ .devcontainer/.gitignore | 2 + .devcontainer/devcontainer.json | 37 ++++++++++ .devcontainer/docker-compose.yml | 70 +++++++++++++++++++ DockerSetup.md | 35 ++++++++++ .editorconfig => src/.editorconfig | 0 .env.example => src/.env.example | 0 .gitattributes => src/.gitattributes | 0 .gitignore => src/.gitignore | 0 .styleci.yml => src/.styleci.yml | 0 {app => src/app}/Console/Kernel.php | 0 {app => src/app}/Exceptions/Handler.php | 0 .../app}/Http/Controllers/Controller.php | 0 .../app}/Http/Controllers/PostController.php | 0 {app => src/app}/Http/Kernel.php | 0 .../app}/Http/Middleware/Authenticate.php | 0 .../app}/Http/Middleware/EncryptCookies.php | 0 .../PreventRequestsDuringMaintenance.php | 0 .../Middleware/RedirectIfAuthenticated.php | 0 .../app}/Http/Middleware/TrimStrings.php | 0 .../app}/Http/Middleware/TrustHosts.php | 0 .../app}/Http/Middleware/TrustProxies.php | 0 .../app}/Http/Middleware/VerifyCsrfToken.php | 0 {app => src/app}/Models/Author.php | 0 {app => src/app}/Models/Book.php | 0 {app => src/app}/Models/CustomerMongoDB.php | 0 {app => src/app}/Models/CustomerSQL.php | 0 {app => src/app}/Models/Post.php | 0 {app => src/app}/Models/User.php | 0 .../app}/Providers/AppServiceProvider.php | 0 .../app}/Providers/AuthServiceProvider.php | 0 .../Providers/BroadcastServiceProvider.php | 0 .../app}/Providers/EventServiceProvider.php | 0 .../app}/Providers/RouteServiceProvider.php | 0 artisan => src/artisan | 0 {bootstrap => src/bootstrap}/app.php | 0 {bootstrap => src/bootstrap}/cache/.gitignore | 0 composer.json => src/composer.json | 0 composer.lock => src/composer.lock | 0 {config => src/config}/app.php | 0 {config => src/config}/auth.php | 0 {config => src/config}/broadcasting.php | 0 {config => src/config}/cache.php | 0 {config => src/config}/cors.php | 0 {config => src/config}/database.php | 0 {config => src/config}/filesystems.php | 0 {config => src/config}/hashing.php | 0 {config => src/config}/logging.php | 0 {config => src/config}/mail.php | 0 {config => src/config}/queue.php | 0 {config => src/config}/sanctum.php | 0 {config => src/config}/services.php | 0 {config => src/config}/session.php | 0 {config => src/config}/view.php | 0 {database => src/database}/.gitignore | 0 .../database}/factories/UserFactory.php | 0 .../2014_10_12_000000_create_users_table.php | 0 ...12_100000_create_password_resets_table.php | 0 ..._08_19_000000_create_failed_jobs_table.php | 0 ...01_create_personal_access_tokens_table.php | 0 .../2023_07_19_225321_create_posts_table.php | 0 ...3_202445_create_customer_s_q_l_s_table.php | 0 ..._051124_create_customer_mongo_db_table.php | 0 .../database}/seeders/DatabaseSeeder.php | 0 {lang => src/lang}/en.json | 0 {lang => src/lang}/en/auth.php | 0 {lang => src/lang}/en/pagination.php | 0 {lang => src/lang}/en/passwords.php | 0 {lang => src/lang}/en/validation.php | 0 package.json => src/package.json | 0 phpunit.xml => src/phpunit.xml | 0 {public => src/public}/.htaccess | 0 {public => src/public}/favicon.ico | 0 {public => src/public}/index.php | 0 {public => src/public}/robots.txt | 0 {resources => src/resources}/css/app.css | 0 {resources => src/resources}/js/app.js | 0 {resources => src/resources}/js/bootstrap.js | 0 .../resources}/views/post.blade.php | 0 .../resources}/views/welcome.blade.php | 0 {routes => src/routes}/api.php | 0 {routes => src/routes}/channels.php | 0 {routes => src/routes}/console.php | 0 {routes => src/routes}/web.php | 0 {storage => src/storage}/app/.gitignore | 0 .../storage}/app/public/.gitignore | 0 {storage => src/storage}/framework/.gitignore | 0 .../storage}/framework/cache/.gitignore | 0 .../storage}/framework/cache/data/.gitignore | 0 .../storage}/framework/sessions/.gitignore | 0 .../storage}/framework/testing/.gitignore | 0 .../storage}/framework/views/.gitignore | 0 {storage => src/storage}/logs/.gitignore | 0 {tests => src/tests}/CreatesApplication.php | 0 {tests => src/tests}/Feature/ExampleTest.php | 0 {tests => src/tests}/TestCase.php | 0 {tests => src/tests}/Unit/ExampleTest.php | 0 webpack.mix.js => src/webpack.mix.js | 0 103 files changed, 250 insertions(+) create mode 100644 .devcontainer/.docker/nginx/conf.d/error_reporting.ini create mode 100644 .devcontainer/.docker/nginx/conf.d/php.conf create mode 100644 .devcontainer/.docker/php/Dockerfile create mode 100644 .devcontainer/.docker/php/docker-php.ini create mode 100644 .devcontainer/.docker/php/xdebug.ini create mode 100644 .devcontainer/.env create mode 100644 .devcontainer/.gitignore create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml create mode 100644 DockerSetup.md rename .editorconfig => src/.editorconfig (100%) rename .env.example => src/.env.example (100%) rename .gitattributes => src/.gitattributes (100%) rename .gitignore => src/.gitignore (100%) rename .styleci.yml => src/.styleci.yml (100%) rename {app => src/app}/Console/Kernel.php (100%) rename {app => src/app}/Exceptions/Handler.php (100%) rename {app => src/app}/Http/Controllers/Controller.php (100%) rename {app => src/app}/Http/Controllers/PostController.php (100%) rename {app => src/app}/Http/Kernel.php (100%) rename {app => src/app}/Http/Middleware/Authenticate.php (100%) rename {app => src/app}/Http/Middleware/EncryptCookies.php (100%) rename {app => src/app}/Http/Middleware/PreventRequestsDuringMaintenance.php (100%) rename {app => src/app}/Http/Middleware/RedirectIfAuthenticated.php (100%) rename {app => src/app}/Http/Middleware/TrimStrings.php (100%) rename {app => src/app}/Http/Middleware/TrustHosts.php (100%) rename {app => src/app}/Http/Middleware/TrustProxies.php (100%) rename {app => src/app}/Http/Middleware/VerifyCsrfToken.php (100%) rename {app => src/app}/Models/Author.php (100%) rename {app => src/app}/Models/Book.php (100%) rename {app => src/app}/Models/CustomerMongoDB.php (100%) rename {app => src/app}/Models/CustomerSQL.php (100%) rename {app => src/app}/Models/Post.php (100%) rename {app => src/app}/Models/User.php (100%) rename {app => src/app}/Providers/AppServiceProvider.php (100%) rename {app => src/app}/Providers/AuthServiceProvider.php (100%) rename {app => src/app}/Providers/BroadcastServiceProvider.php (100%) rename {app => src/app}/Providers/EventServiceProvider.php (100%) rename {app => src/app}/Providers/RouteServiceProvider.php (100%) rename artisan => src/artisan (100%) rename {bootstrap => src/bootstrap}/app.php (100%) rename {bootstrap => src/bootstrap}/cache/.gitignore (100%) rename composer.json => src/composer.json (100%) rename composer.lock => src/composer.lock (100%) rename {config => src/config}/app.php (100%) rename {config => src/config}/auth.php (100%) rename {config => src/config}/broadcasting.php (100%) rename {config => src/config}/cache.php (100%) rename {config => src/config}/cors.php (100%) rename {config => src/config}/database.php (100%) rename {config => src/config}/filesystems.php (100%) rename {config => src/config}/hashing.php (100%) rename {config => src/config}/logging.php (100%) rename {config => src/config}/mail.php (100%) rename {config => src/config}/queue.php (100%) rename {config => src/config}/sanctum.php (100%) rename {config => src/config}/services.php (100%) rename {config => src/config}/session.php (100%) rename {config => src/config}/view.php (100%) rename {database => src/database}/.gitignore (100%) rename {database => src/database}/factories/UserFactory.php (100%) rename {database => src/database}/migrations/2014_10_12_000000_create_users_table.php (100%) rename {database => src/database}/migrations/2014_10_12_100000_create_password_resets_table.php (100%) rename {database => src/database}/migrations/2019_08_19_000000_create_failed_jobs_table.php (100%) rename {database => src/database}/migrations/2019_12_14_000001_create_personal_access_tokens_table.php (100%) rename {database => src/database}/migrations/2023_07_19_225321_create_posts_table.php (100%) rename {database => src/database}/migrations/2023_08_03_202445_create_customer_s_q_l_s_table.php (100%) rename {database => src/database}/migrations/2023_08_09_051124_create_customer_mongo_db_table.php (100%) rename {database => src/database}/seeders/DatabaseSeeder.php (100%) rename {lang => src/lang}/en.json (100%) rename {lang => src/lang}/en/auth.php (100%) rename {lang => src/lang}/en/pagination.php (100%) rename {lang => src/lang}/en/passwords.php (100%) rename {lang => src/lang}/en/validation.php (100%) rename package.json => src/package.json (100%) rename phpunit.xml => src/phpunit.xml (100%) rename {public => src/public}/.htaccess (100%) rename {public => src/public}/favicon.ico (100%) rename {public => src/public}/index.php (100%) rename {public => src/public}/robots.txt (100%) rename {resources => src/resources}/css/app.css (100%) rename {resources => src/resources}/js/app.js (100%) rename {resources => src/resources}/js/bootstrap.js (100%) rename {resources => src/resources}/views/post.blade.php (100%) rename {resources => src/resources}/views/welcome.blade.php (100%) rename {routes => src/routes}/api.php (100%) rename {routes => src/routes}/channels.php (100%) rename {routes => src/routes}/console.php (100%) rename {routes => src/routes}/web.php (100%) rename {storage => src/storage}/app/.gitignore (100%) rename {storage => src/storage}/app/public/.gitignore (100%) rename {storage => src/storage}/framework/.gitignore (100%) rename {storage => src/storage}/framework/cache/.gitignore (100%) rename {storage => src/storage}/framework/cache/data/.gitignore (100%) rename {storage => src/storage}/framework/sessions/.gitignore (100%) rename {storage => src/storage}/framework/testing/.gitignore (100%) rename {storage => src/storage}/framework/views/.gitignore (100%) rename {storage => src/storage}/logs/.gitignore (100%) rename {tests => src/tests}/CreatesApplication.php (100%) rename {tests => src/tests}/Feature/ExampleTest.php (100%) rename {tests => src/tests}/TestCase.php (100%) rename {tests => src/tests}/Unit/ExampleTest.php (100%) rename webpack.mix.js => src/webpack.mix.js (100%) diff --git a/.devcontainer/.docker/nginx/conf.d/error_reporting.ini b/.devcontainer/.docker/nginx/conf.d/error_reporting.ini new file mode 100644 index 0000000..d040e65 --- /dev/null +++ b/.devcontainer/.docker/nginx/conf.d/error_reporting.ini @@ -0,0 +1 @@ +error_reporting=E_ALL \ No newline at end of file diff --git a/.devcontainer/.docker/nginx/conf.d/php.conf b/.devcontainer/.docker/nginx/conf.d/php.conf new file mode 100644 index 0000000..f95d70d --- /dev/null +++ b/.devcontainer/.docker/nginx/conf.d/php.conf @@ -0,0 +1,14 @@ + +server { + listen 80 default_server; + listen [::]:80 default_server; + root /var/www/htdoc; + index index.php; + + location ~* \.php$ { + fastcgi_pass php:9000; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + } +} \ No newline at end of file diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile new file mode 100644 index 0000000..b37df05 --- /dev/null +++ b/.devcontainer/.docker/php/Dockerfile @@ -0,0 +1,54 @@ +# defined in docker-compose.yml, from docker-env.env +ARG RUNTIME_PHP_IMAGE + +# Use the specified image as the base +FROM ${RUNTIME_PHP_IMAGE} + +# Update the packages +# Install system packages required for MongoDB extension +RUN apt-get update \ + && apt-get install -y libssl-dev wget git unzip + +RUN pecl apt update \ + && apt install libzip-dev -y \ + && docker-php-ext-install zip \ + && rm -rf /var/lib/apt/lists/* + +# Required for MySQL to work in PHP +RUN docker-php-ext-install mysqli + +# Test if already installed and +# install the mongodb PHP extension +# RUN pecl install mongodb && docker-php-ext-enable mongodb +RUN bash -c '[[ -n "$(pecl list | grep mongodb)" ]]\ + || (pecl install mongodb && docker-php-ext-enable mongodb)' + +# Test if already installed and +# install and enable XDEBUG +# RUN pecl install xdebug && docker-php-ext-enable xdebug +RUN bash -c '[[ -n "$(pecl list | grep xdebug)" ]]\ + || (pecl install xdebug && docker-php-ext-enable xdebug)' + +# install Redis PHP driver +RUN pecl install -o -f redis \ +&& rm -rf /tmp/pear \ +&& docker-php-ext-enable redis + +# Task: copy rep's PHP .ini files to be automatically parsed +# +# directory is related to the PHP service context +# dot NOT use ./filename.ext for root files +# use filename.ext +COPY docker-php.ini /usr/local/etc/php/conf.d/ +COPY xdebug.ini /usr/local/etc/php/conf.d/ + +# Install Composer +# ---------------------------------------------------------- +# download composer +RUN curl -sS https://getcomposer.org/installer | php +# copy composer to a place where it can be globally executed +RUN mv composer.phar /usr/local/bin/composer + +# NOT REQUIRED +# Change to non-root privilege +# USER www-data \ No newline at end of file diff --git a/.devcontainer/.docker/php/docker-php.ini b/.devcontainer/.docker/php/docker-php.ini new file mode 100644 index 0000000..fa19660 --- /dev/null +++ b/.devcontainer/.docker/php/docker-php.ini @@ -0,0 +1 @@ +# hubert stuff \ No newline at end of file diff --git a/.devcontainer/.docker/php/xdebug.ini b/.devcontainer/.docker/php/xdebug.ini new file mode 100644 index 0000000..955fc34 --- /dev/null +++ b/.devcontainer/.docker/php/xdebug.ini @@ -0,0 +1,11 @@ +# already loaded in /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +#zend_extension=xdebug + +[xdebug] +xdebug.mode=debug +xdebug.client_host=host.docker.internal +xdebug.start_with_request=yes +;xdebug.discover_client_host=1 +xdebug.client_port=9003 +xdebug.idekey=PHPSTORM +xdebug.log=/tmp/xdebug.log \ No newline at end of file diff --git a/.devcontainer/.env b/.devcontainer/.env new file mode 100644 index 0000000..bf314e9 --- /dev/null +++ b/.devcontainer/.env @@ -0,0 +1,25 @@ +# PATHs are relative to docker-compose.yml + +NGINX_IMAGE=nginx:alpine +NGINX_HOST_PORT=80 +NGINX_CONTAINER_PORT=80 +NGINX_HOST_CONFD_DIR=./.docker/nginx/conf.d +NGINX_CONTAINER_CONFD_DIR=/etc/nginx/conf.d + +WEBROOT_HOST_PATH=../src/public +WEBROOT_CONTAINER_PATH=/var/www/htdoc + +NGINX_WEBROOT_HOST_PATH=../src/public +NGINX_WEBROOT_CONTAINER_PATH=/var/www/htdoc + +MYSQL_IMAGE=mysql:5.7 +MYSQL_DATA_HOST_PATH=./data/mysql +MYSQL_DATA_CONTAINER_PATH=/var/lib/mysql +MYSQL_HOST_PORT=3306 +MYSQL_CONTAINER_PORT=3306 + +PHP_IMAGE=php:8.2-fpm + + +REDIS_DATA_HOST_PATH=./data/redis +REDIS_DATA_CONTAINER_PATH=/etc/data \ No newline at end of file diff --git a/.devcontainer/.gitignore b/.devcontainer/.gitignore new file mode 100644 index 0000000..5bf9577 --- /dev/null +++ b/.devcontainer/.gitignore @@ -0,0 +1,2 @@ +/data/ +/www/ \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..c713bf7 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +{ + // Mandatory definition for .devcontainer + // + // which service AS DEFINED IN .devcontainer/docker-compose.yml + // do we want VS Code to attach to? + // here, we choose the "php" service since that's where our code is executed + "service": "php", + + // we have multiple containers (nginx, PHP, MySQL, redis) + // so we'll use a compose .yml file instead of defining the services in devcontainer.json + "dockerComposeFile": "./docker-compose.yml", + + // Mandatory definition for .devcontainer + // + // workspaceFolder describes the CONTAINER folder + // in which the "service" (php here) is configured to mount the project + // in our case, "/var/www/htdoc" refers to + // ${WEBROOT_HOST_PATH}:${WEBROOT_CONTAINER_PATH} in our "php" service "volumeS" + // these are defined in .devcontainer/.env as follows: + // WEBROOT_HOST_PATH=../src + // WEBROOT_CONTAINER_PATH=/var/www/htdoc + "workspaceFolder": "/var/www/htdoc", + + // NOT REQUIRED, because our mounts are defined in the .yml file + // + // mount defined in docker-compose.yml + //"mounts": [ + // "source=${localWorkspaceFolder},target=/src,type=bind" + //], + + // "xdebug.php-debug" = official XDEBUG extension + "customizations": { + "vscode": { + "extensions": ["xdebug.php-debug"] + } + } +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..54247b6 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,70 @@ +# build command: docker compose build +# docker uses the .env file BY DEFAULT. Any other name and you'll have to specify it in the command line +# docker compose --env-file FILENAME.env build + +# docker compose version +version: '3.4' + +# Services +services: + + # Nginx Service + nginx: + + image: ${NGINX_IMAGE} + ports: + - ${NGINX_HOST_PORT}:${NGINX_CONTAINER_PORT} + + # path is relative to where the docker-compose.yml file is. + # local-path : container-path + # + volumes: + # public web files + - ${NGINX_WEBROOT_HOST_PATH}:${NGINX_WEBROOT_CONTAINER_PATH} + # .ini location + - ${NGINX_HOST_CONFD_DIR}:${NGINX_CONTAINER_CONFD_DIR} + depends_on: + - php + - mysql + + # PHP Service + php: + build: + context: ./.docker/php + dockerfile: Dockerfile + args: + RUNTIME_PHP_IMAGE: ${PHP_IMAGE} + image: ${PHP_IMAGE} + # container-path + working_dir: ${WEBROOT_CONTAINER_PATH} + # disk local-path + volumes: + - ${WEBROOT_HOST_PATH}:${WEBROOT_CONTAINER_PATH} + + + # MySQL Service + mysql: + image: ${MYSQL_IMAGE} + environment: + MYSQL_ROOT_PASSWORD: rootpassword + MYSQL_DATABASE: mydatabase + MYSQL_USER: rootuser + MYSQL_PASSWORD: mypassword + volumes: + # map local /data/ folder to container /var/lib/mysql for MySQL data persistence + - ${MYSQL_DATA_HOST_PATH}:${MYSQL_DATA_CONTAINER_PATH} + ports: + - "${MYSQL_HOST_PORT}:${MYSQL_CONTAINER_PORT}" + + + redis: + image: redis:latest + ports: + - "6379:6379" + volumes: + - ${REDIS_DATA_HOST_PATH}:${REDIS_DATA_CONTAINER_PATH} + +# Notes: +# +# From Docker Compose version 3.4 the name of the volume can be dynamically generated from environment variables placed in an .env file (this file has to be in the same folder as docker-compose.yml is). +# diff --git a/DockerSetup.md b/DockerSetup.md new file mode 100644 index 0000000..a346fc7 --- /dev/null +++ b/DockerSetup.md @@ -0,0 +1,35 @@ +# proposed directory structure to integrate Docker and .devcontainer + +/repository-root +│ +├── .devcontainer/ +│ ├── devcontainer.json +│ └── Dockerfile +│ +├── docker/ +│ ├── nginx/ +│ │ └── default.conf +│ ├── mysql/ +│ │ └── my.cnf +│ └── php/ +│ └── Dockerfile +│ +├── docker-compose.yml +│ +├── src/ +│ ├── app/ +│ ├── bootstrap/ +│ ├── config/ +│ ├── database/ +│ ├── public/ +│ ├── resources/ +│ ├── routes/ +│ ├── storage/ +│ ├── tests/ +│ ├── .env.example +│ ├── .gitignore +│ ├── composer.json +│ ├── phpunit.xml +│ └── ... +│ +└── README.md \ No newline at end of file diff --git a/.editorconfig b/src/.editorconfig similarity index 100% rename from .editorconfig rename to src/.editorconfig diff --git a/.env.example b/src/.env.example similarity index 100% rename from .env.example rename to src/.env.example diff --git a/.gitattributes b/src/.gitattributes similarity index 100% rename from .gitattributes rename to src/.gitattributes diff --git a/.gitignore b/src/.gitignore similarity index 100% rename from .gitignore rename to src/.gitignore diff --git a/.styleci.yml b/src/.styleci.yml similarity index 100% rename from .styleci.yml rename to src/.styleci.yml diff --git a/app/Console/Kernel.php b/src/app/Console/Kernel.php similarity index 100% rename from app/Console/Kernel.php rename to src/app/Console/Kernel.php diff --git a/app/Exceptions/Handler.php b/src/app/Exceptions/Handler.php similarity index 100% rename from app/Exceptions/Handler.php rename to src/app/Exceptions/Handler.php diff --git a/app/Http/Controllers/Controller.php b/src/app/Http/Controllers/Controller.php similarity index 100% rename from app/Http/Controllers/Controller.php rename to src/app/Http/Controllers/Controller.php diff --git a/app/Http/Controllers/PostController.php b/src/app/Http/Controllers/PostController.php similarity index 100% rename from app/Http/Controllers/PostController.php rename to src/app/Http/Controllers/PostController.php diff --git a/app/Http/Kernel.php b/src/app/Http/Kernel.php similarity index 100% rename from app/Http/Kernel.php rename to src/app/Http/Kernel.php diff --git a/app/Http/Middleware/Authenticate.php b/src/app/Http/Middleware/Authenticate.php similarity index 100% rename from app/Http/Middleware/Authenticate.php rename to src/app/Http/Middleware/Authenticate.php diff --git a/app/Http/Middleware/EncryptCookies.php b/src/app/Http/Middleware/EncryptCookies.php similarity index 100% rename from app/Http/Middleware/EncryptCookies.php rename to src/app/Http/Middleware/EncryptCookies.php diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/src/app/Http/Middleware/PreventRequestsDuringMaintenance.php similarity index 100% rename from app/Http/Middleware/PreventRequestsDuringMaintenance.php rename to src/app/Http/Middleware/PreventRequestsDuringMaintenance.php diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/src/app/Http/Middleware/RedirectIfAuthenticated.php similarity index 100% rename from app/Http/Middleware/RedirectIfAuthenticated.php rename to src/app/Http/Middleware/RedirectIfAuthenticated.php diff --git a/app/Http/Middleware/TrimStrings.php b/src/app/Http/Middleware/TrimStrings.php similarity index 100% rename from app/Http/Middleware/TrimStrings.php rename to src/app/Http/Middleware/TrimStrings.php diff --git a/app/Http/Middleware/TrustHosts.php b/src/app/Http/Middleware/TrustHosts.php similarity index 100% rename from app/Http/Middleware/TrustHosts.php rename to src/app/Http/Middleware/TrustHosts.php diff --git a/app/Http/Middleware/TrustProxies.php b/src/app/Http/Middleware/TrustProxies.php similarity index 100% rename from app/Http/Middleware/TrustProxies.php rename to src/app/Http/Middleware/TrustProxies.php diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/src/app/Http/Middleware/VerifyCsrfToken.php similarity index 100% rename from app/Http/Middleware/VerifyCsrfToken.php rename to src/app/Http/Middleware/VerifyCsrfToken.php diff --git a/app/Models/Author.php b/src/app/Models/Author.php similarity index 100% rename from app/Models/Author.php rename to src/app/Models/Author.php diff --git a/app/Models/Book.php b/src/app/Models/Book.php similarity index 100% rename from app/Models/Book.php rename to src/app/Models/Book.php diff --git a/app/Models/CustomerMongoDB.php b/src/app/Models/CustomerMongoDB.php similarity index 100% rename from app/Models/CustomerMongoDB.php rename to src/app/Models/CustomerMongoDB.php diff --git a/app/Models/CustomerSQL.php b/src/app/Models/CustomerSQL.php similarity index 100% rename from app/Models/CustomerSQL.php rename to src/app/Models/CustomerSQL.php diff --git a/app/Models/Post.php b/src/app/Models/Post.php similarity index 100% rename from app/Models/Post.php rename to src/app/Models/Post.php diff --git a/app/Models/User.php b/src/app/Models/User.php similarity index 100% rename from app/Models/User.php rename to src/app/Models/User.php diff --git a/app/Providers/AppServiceProvider.php b/src/app/Providers/AppServiceProvider.php similarity index 100% rename from app/Providers/AppServiceProvider.php rename to src/app/Providers/AppServiceProvider.php diff --git a/app/Providers/AuthServiceProvider.php b/src/app/Providers/AuthServiceProvider.php similarity index 100% rename from app/Providers/AuthServiceProvider.php rename to src/app/Providers/AuthServiceProvider.php diff --git a/app/Providers/BroadcastServiceProvider.php b/src/app/Providers/BroadcastServiceProvider.php similarity index 100% rename from app/Providers/BroadcastServiceProvider.php rename to src/app/Providers/BroadcastServiceProvider.php diff --git a/app/Providers/EventServiceProvider.php b/src/app/Providers/EventServiceProvider.php similarity index 100% rename from app/Providers/EventServiceProvider.php rename to src/app/Providers/EventServiceProvider.php diff --git a/app/Providers/RouteServiceProvider.php b/src/app/Providers/RouteServiceProvider.php similarity index 100% rename from app/Providers/RouteServiceProvider.php rename to src/app/Providers/RouteServiceProvider.php diff --git a/artisan b/src/artisan similarity index 100% rename from artisan rename to src/artisan diff --git a/bootstrap/app.php b/src/bootstrap/app.php similarity index 100% rename from bootstrap/app.php rename to src/bootstrap/app.php diff --git a/bootstrap/cache/.gitignore b/src/bootstrap/cache/.gitignore similarity index 100% rename from bootstrap/cache/.gitignore rename to src/bootstrap/cache/.gitignore diff --git a/composer.json b/src/composer.json similarity index 100% rename from composer.json rename to src/composer.json diff --git a/composer.lock b/src/composer.lock similarity index 100% rename from composer.lock rename to src/composer.lock diff --git a/config/app.php b/src/config/app.php similarity index 100% rename from config/app.php rename to src/config/app.php diff --git a/config/auth.php b/src/config/auth.php similarity index 100% rename from config/auth.php rename to src/config/auth.php diff --git a/config/broadcasting.php b/src/config/broadcasting.php similarity index 100% rename from config/broadcasting.php rename to src/config/broadcasting.php diff --git a/config/cache.php b/src/config/cache.php similarity index 100% rename from config/cache.php rename to src/config/cache.php diff --git a/config/cors.php b/src/config/cors.php similarity index 100% rename from config/cors.php rename to src/config/cors.php diff --git a/config/database.php b/src/config/database.php similarity index 100% rename from config/database.php rename to src/config/database.php diff --git a/config/filesystems.php b/src/config/filesystems.php similarity index 100% rename from config/filesystems.php rename to src/config/filesystems.php diff --git a/config/hashing.php b/src/config/hashing.php similarity index 100% rename from config/hashing.php rename to src/config/hashing.php diff --git a/config/logging.php b/src/config/logging.php similarity index 100% rename from config/logging.php rename to src/config/logging.php diff --git a/config/mail.php b/src/config/mail.php similarity index 100% rename from config/mail.php rename to src/config/mail.php diff --git a/config/queue.php b/src/config/queue.php similarity index 100% rename from config/queue.php rename to src/config/queue.php diff --git a/config/sanctum.php b/src/config/sanctum.php similarity index 100% rename from config/sanctum.php rename to src/config/sanctum.php diff --git a/config/services.php b/src/config/services.php similarity index 100% rename from config/services.php rename to src/config/services.php diff --git a/config/session.php b/src/config/session.php similarity index 100% rename from config/session.php rename to src/config/session.php diff --git a/config/view.php b/src/config/view.php similarity index 100% rename from config/view.php rename to src/config/view.php diff --git a/database/.gitignore b/src/database/.gitignore similarity index 100% rename from database/.gitignore rename to src/database/.gitignore diff --git a/database/factories/UserFactory.php b/src/database/factories/UserFactory.php similarity index 100% rename from database/factories/UserFactory.php rename to src/database/factories/UserFactory.php diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/src/database/migrations/2014_10_12_000000_create_users_table.php similarity index 100% rename from database/migrations/2014_10_12_000000_create_users_table.php rename to src/database/migrations/2014_10_12_000000_create_users_table.php diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/src/database/migrations/2014_10_12_100000_create_password_resets_table.php similarity index 100% rename from database/migrations/2014_10_12_100000_create_password_resets_table.php rename to src/database/migrations/2014_10_12_100000_create_password_resets_table.php diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/src/database/migrations/2019_08_19_000000_create_failed_jobs_table.php similarity index 100% rename from database/migrations/2019_08_19_000000_create_failed_jobs_table.php rename to src/database/migrations/2019_08_19_000000_create_failed_jobs_table.php diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/src/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php similarity index 100% rename from database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php rename to src/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php diff --git a/database/migrations/2023_07_19_225321_create_posts_table.php b/src/database/migrations/2023_07_19_225321_create_posts_table.php similarity index 100% rename from database/migrations/2023_07_19_225321_create_posts_table.php rename to src/database/migrations/2023_07_19_225321_create_posts_table.php diff --git a/database/migrations/2023_08_03_202445_create_customer_s_q_l_s_table.php b/src/database/migrations/2023_08_03_202445_create_customer_s_q_l_s_table.php similarity index 100% rename from database/migrations/2023_08_03_202445_create_customer_s_q_l_s_table.php rename to src/database/migrations/2023_08_03_202445_create_customer_s_q_l_s_table.php diff --git a/database/migrations/2023_08_09_051124_create_customer_mongo_db_table.php b/src/database/migrations/2023_08_09_051124_create_customer_mongo_db_table.php similarity index 100% rename from database/migrations/2023_08_09_051124_create_customer_mongo_db_table.php rename to src/database/migrations/2023_08_09_051124_create_customer_mongo_db_table.php diff --git a/database/seeders/DatabaseSeeder.php b/src/database/seeders/DatabaseSeeder.php similarity index 100% rename from database/seeders/DatabaseSeeder.php rename to src/database/seeders/DatabaseSeeder.php diff --git a/lang/en.json b/src/lang/en.json similarity index 100% rename from lang/en.json rename to src/lang/en.json diff --git a/lang/en/auth.php b/src/lang/en/auth.php similarity index 100% rename from lang/en/auth.php rename to src/lang/en/auth.php diff --git a/lang/en/pagination.php b/src/lang/en/pagination.php similarity index 100% rename from lang/en/pagination.php rename to src/lang/en/pagination.php diff --git a/lang/en/passwords.php b/src/lang/en/passwords.php similarity index 100% rename from lang/en/passwords.php rename to src/lang/en/passwords.php diff --git a/lang/en/validation.php b/src/lang/en/validation.php similarity index 100% rename from lang/en/validation.php rename to src/lang/en/validation.php diff --git a/package.json b/src/package.json similarity index 100% rename from package.json rename to src/package.json diff --git a/phpunit.xml b/src/phpunit.xml similarity index 100% rename from phpunit.xml rename to src/phpunit.xml diff --git a/public/.htaccess b/src/public/.htaccess similarity index 100% rename from public/.htaccess rename to src/public/.htaccess diff --git a/public/favicon.ico b/src/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to src/public/favicon.ico diff --git a/public/index.php b/src/public/index.php similarity index 100% rename from public/index.php rename to src/public/index.php diff --git a/public/robots.txt b/src/public/robots.txt similarity index 100% rename from public/robots.txt rename to src/public/robots.txt diff --git a/resources/css/app.css b/src/resources/css/app.css similarity index 100% rename from resources/css/app.css rename to src/resources/css/app.css diff --git a/resources/js/app.js b/src/resources/js/app.js similarity index 100% rename from resources/js/app.js rename to src/resources/js/app.js diff --git a/resources/js/bootstrap.js b/src/resources/js/bootstrap.js similarity index 100% rename from resources/js/bootstrap.js rename to src/resources/js/bootstrap.js diff --git a/resources/views/post.blade.php b/src/resources/views/post.blade.php similarity index 100% rename from resources/views/post.blade.php rename to src/resources/views/post.blade.php diff --git a/resources/views/welcome.blade.php b/src/resources/views/welcome.blade.php similarity index 100% rename from resources/views/welcome.blade.php rename to src/resources/views/welcome.blade.php diff --git a/routes/api.php b/src/routes/api.php similarity index 100% rename from routes/api.php rename to src/routes/api.php diff --git a/routes/channels.php b/src/routes/channels.php similarity index 100% rename from routes/channels.php rename to src/routes/channels.php diff --git a/routes/console.php b/src/routes/console.php similarity index 100% rename from routes/console.php rename to src/routes/console.php diff --git a/routes/web.php b/src/routes/web.php similarity index 100% rename from routes/web.php rename to src/routes/web.php diff --git a/storage/app/.gitignore b/src/storage/app/.gitignore similarity index 100% rename from storage/app/.gitignore rename to src/storage/app/.gitignore diff --git a/storage/app/public/.gitignore b/src/storage/app/public/.gitignore similarity index 100% rename from storage/app/public/.gitignore rename to src/storage/app/public/.gitignore diff --git a/storage/framework/.gitignore b/src/storage/framework/.gitignore similarity index 100% rename from storage/framework/.gitignore rename to src/storage/framework/.gitignore diff --git a/storage/framework/cache/.gitignore b/src/storage/framework/cache/.gitignore similarity index 100% rename from storage/framework/cache/.gitignore rename to src/storage/framework/cache/.gitignore diff --git a/storage/framework/cache/data/.gitignore b/src/storage/framework/cache/data/.gitignore similarity index 100% rename from storage/framework/cache/data/.gitignore rename to src/storage/framework/cache/data/.gitignore diff --git a/storage/framework/sessions/.gitignore b/src/storage/framework/sessions/.gitignore similarity index 100% rename from storage/framework/sessions/.gitignore rename to src/storage/framework/sessions/.gitignore diff --git a/storage/framework/testing/.gitignore b/src/storage/framework/testing/.gitignore similarity index 100% rename from storage/framework/testing/.gitignore rename to src/storage/framework/testing/.gitignore diff --git a/storage/framework/views/.gitignore b/src/storage/framework/views/.gitignore similarity index 100% rename from storage/framework/views/.gitignore rename to src/storage/framework/views/.gitignore diff --git a/storage/logs/.gitignore b/src/storage/logs/.gitignore similarity index 100% rename from storage/logs/.gitignore rename to src/storage/logs/.gitignore diff --git a/tests/CreatesApplication.php b/src/tests/CreatesApplication.php similarity index 100% rename from tests/CreatesApplication.php rename to src/tests/CreatesApplication.php diff --git a/tests/Feature/ExampleTest.php b/src/tests/Feature/ExampleTest.php similarity index 100% rename from tests/Feature/ExampleTest.php rename to src/tests/Feature/ExampleTest.php diff --git a/tests/TestCase.php b/src/tests/TestCase.php similarity index 100% rename from tests/TestCase.php rename to src/tests/TestCase.php diff --git a/tests/Unit/ExampleTest.php b/src/tests/Unit/ExampleTest.php similarity index 100% rename from tests/Unit/ExampleTest.php rename to src/tests/Unit/ExampleTest.php diff --git a/webpack.mix.js b/src/webpack.mix.js similarity index 100% rename from webpack.mix.js rename to src/webpack.mix.js From 6e47eed25562d5a7032bcf97d961c393d6c07d54 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Fri, 25 Aug 2023 09:35:06 -0700 Subject: [PATCH 02/18] Laravel is now up and running with docker - docker .env PHP mount points modified. For laravel, serving from /public/ should be done at the NGINX level. PHP still needs access to everything that is in /src/ - Renamed the nginx php.conf file into nginx-webserver.conf - changed nginx-webserver.conf to match more closely the official Laravel settings. The previous config did not work with the Laravel Routes - in the php Dockerfile, added error files init for xdebug and php-errors - made small changes in xdebug.ini (php container) to get rid of unwanted "error" messages such as Client is not listening. NOT TESTED WITH ACTUAL STEp-DEBUG yet. Next: try devcontainer Next: try localhost step-debug --- .../.docker/nginx/conf.d/nginx-webserver.conf | 38 +++++++++++++++ .devcontainer/.docker/nginx/conf.d/php.conf | 14 ------ .devcontainer/.docker/php/Dockerfile | 18 ++++++- .devcontainer/.docker/php/xdebug.ini | 48 ++++++++++++++++--- .devcontainer/.env | 6 +-- .devcontainer/docker-compose.yml | 4 +- README.md | 13 ++++- src/public/index.php | 9 ++++ 8 files changed, 123 insertions(+), 27 deletions(-) create mode 100644 .devcontainer/.docker/nginx/conf.d/nginx-webserver.conf delete mode 100644 .devcontainer/.docker/nginx/conf.d/php.conf diff --git a/.devcontainer/.docker/nginx/conf.d/nginx-webserver.conf b/.devcontainer/.docker/nginx/conf.d/nginx-webserver.conf new file mode 100644 index 0000000..7a184e3 --- /dev/null +++ b/.devcontainer/.docker/nginx/conf.d/nginx-webserver.conf @@ -0,0 +1,38 @@ +# this server config works with Laravel too +server { + listen 80; + listen [::]:80 default_server; + + # not needed for now + # server_name example.com; + + root /var/www/htdoc/public; + + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-Content-Type-Options "nosniff"; + + index index.php; + + charset utf-8; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location = /favicon.ico { access_log off; log_not_found off; } + location = /robots.txt { access_log off; log_not_found off; } + + error_page 404 /index.php; + + location ~* \.php$ { + fastcgi_pass php:9000; + + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + } + + location ~ /\.(?!well-known).* { + deny all; + } +} \ No newline at end of file diff --git a/.devcontainer/.docker/nginx/conf.d/php.conf b/.devcontainer/.docker/nginx/conf.d/php.conf deleted file mode 100644 index f95d70d..0000000 --- a/.devcontainer/.docker/nginx/conf.d/php.conf +++ /dev/null @@ -1,14 +0,0 @@ - -server { - listen 80 default_server; - listen [::]:80 default_server; - root /var/www/htdoc; - index index.php; - - location ~* \.php$ { - fastcgi_pass php:9000; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - } -} \ No newline at end of file diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile index b37df05..882ad27 100644 --- a/.devcontainer/.docker/php/Dockerfile +++ b/.devcontainer/.docker/php/Dockerfile @@ -4,6 +4,12 @@ ARG RUNTIME_PHP_IMAGE # Use the specified image as the base FROM ${RUNTIME_PHP_IMAGE} +# create the log file and provide permission to the www-data user +RUN touch /tmp/xdebug.log && chown www-data:www-data /tmp/xdebug.log + +# same thing for the PHP error log +RUN touch /var/log/php-errors.log && chown www-data:www-data /var/log/php-errors.log + # Update the packages # Install system packages required for MongoDB extension RUN apt-get update \ @@ -51,4 +57,14 @@ RUN mv composer.phar /usr/local/bin/composer # NOT REQUIRED # Change to non-root privilege -# USER www-data \ No newline at end of file +# USER www-data + +# Enable Error-logging in the PHP container +# ---------------------------------------------------------- + +# RUN echo "error_log = /var/log/php-fpm.log" >> /usr/local/etc/php-fpm.d/docker.conf + +#RUN echo "php_admin_value[error_log] = /var/log/php-fpm/www-error.log" >> /usr/local/etc/php-fpm.d/www.conf && \ +# echo "php_admin_flag[log_errors] = on" >> /usr/local/etc/php-fpm.d/www.conf && \ +# echo "catch_workers_output = yes" >> /usr/local/etc/php-fpm.d/www.conf + diff --git a/.devcontainer/.docker/php/xdebug.ini b/.devcontainer/.docker/php/xdebug.ini index 955fc34..6868b64 100644 --- a/.devcontainer/.docker/php/xdebug.ini +++ b/.devcontainer/.docker/php/xdebug.ini @@ -1,11 +1,47 @@ # already loaded in /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini #zend_extension=xdebug +; FIXME : should be elsewhere, like docker-php.ini +error_log = /var/log/php-errors.log +catch_workers_output = yes + [xdebug] -xdebug.mode=debug -xdebug.client_host=host.docker.internal -xdebug.start_with_request=yes -;xdebug.discover_client_host=1 + +; enables step by step debugging +; xdebug.mode=debug,develop +xdebug.mode=develop + +; xdebug.client_host=host.docker.internal + +; set this to 'yes' to ALWAYS start a request/ +; it will complain if not debugger is found listening +; default value is xdebug.start_with_request=trigger, which should be fine +; +; xdebug.start_with_request=yes +xdebug.discover_client_host=1 + xdebug.client_port=9003 -xdebug.idekey=PHPSTORM -xdebug.log=/tmp/xdebug.log \ No newline at end of file + +; No need. By default, this is redirected to the general log of +; of your PHP container and visible from tools like Docker Desktop +; +;xdebug.log=/var/tmp/xdebug.log + +; Color var_dumps when in CLI +xdebug.cli_color=1 + +; redirect the xdebug log to the container's STDOUT (/proc/self/fd/1) or STDERR (/proc/self/fd/2) +xdebug.log=/tmp/xdebug.log + +; 2.x way to activate the debugger. +; generates this message, if not debugger is listening: +; NOTICE: PHP message: Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: host.docker.internal:9003 +; +; xdebug.idekey=PHPSTORM + +; NOTES +; +; the log error "Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION'" +; can be avoided by adding /?XDEBUG_SESSION=start to the page URL being browsed +; +; NOTICE: PHP message: Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: host.docker.internal:9003 \ No newline at end of file diff --git a/.devcontainer/.env b/.devcontainer/.env index bf314e9..4685237 100644 --- a/.devcontainer/.env +++ b/.devcontainer/.env @@ -6,10 +6,10 @@ NGINX_CONTAINER_PORT=80 NGINX_HOST_CONFD_DIR=./.docker/nginx/conf.d NGINX_CONTAINER_CONFD_DIR=/etc/nginx/conf.d -WEBROOT_HOST_PATH=../src/public -WEBROOT_CONTAINER_PATH=/var/www/htdoc +PHP_WEBROOT_HOST_PATH=../src/ +PHP_WEBROOT_CONTAINER_PATH=/var/www/htdoc -NGINX_WEBROOT_HOST_PATH=../src/public +NGINX_WEBROOT_HOST_PATH=../src/ NGINX_WEBROOT_CONTAINER_PATH=/var/www/htdoc MYSQL_IMAGE=mysql:5.7 diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 54247b6..cefe387 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -36,10 +36,10 @@ services: RUNTIME_PHP_IMAGE: ${PHP_IMAGE} image: ${PHP_IMAGE} # container-path - working_dir: ${WEBROOT_CONTAINER_PATH} + working_dir: ${PHP_WEBROOT_CONTAINER_PATH} # disk local-path volumes: - - ${WEBROOT_HOST_PATH}:${WEBROOT_CONTAINER_PATH} + - ${PHP_WEBROOT_HOST_PATH}:${PHP_WEBROOT_CONTAINER_PATH} # MySQL Service diff --git a/README.md b/README.md index 4490cf9..4976a56 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,15 @@ The article mentions several ways to get a Laravel development environment up an ## .env file -Not included in this repo is the .env file that contains the MongoDB connection string with the username / password. You'll have to make a cope of the .env.example file and add this variable: +#### Application key + +Laravel might ask to generate a new application key. You can do it by running this command in the laravel project folder. + +`php artisan key:generate` + +#### MongoDB connection string + +Not included in this repo is the Laravel .env file that contains the MongoDB connection string with the username / password. You'll have to make a cope of the .env.example file and add this variable: `DB_URI=` @@ -23,6 +31,9 @@ The complete URI looks like this: `DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority` +# Troubleshooting + + # Disclaimer Use at your own risk; not a supported MongoDB product \ No newline at end of file diff --git a/src/public/index.php b/src/public/index.php index 1d69f3a..b4a149b 100644 --- a/src/public/index.php +++ b/src/public/index.php @@ -1,5 +1,9 @@ make(Kernel::class); +// CRASH at the line below: + $response = $kernel->handle( $request = Request::capture() )->send(); $kernel->terminate($request, $response); + From b98e77a2c808c45d9c42e066a28fecf1b08145fd Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 30 Aug 2023 16:05:16 -0700 Subject: [PATCH 03/18] minimal xdebug config and more - forward open devcontainer port 80 by default - add local-dev xdebug vonfig \REPO\.vscode\launch.json --- .devcontainer/.docker/php/xdebug.ini | 62 +++++++++++++--------------- .devcontainer/devcontainer.json | 8 +++- .devcontainer/docker-compose.yml | 2 + .vscode/launch.json | 53 ++++++++++++++++++++++++ README.md | 44 +++++++++++++++++++- src/public/index.php | 6 --- 6 files changed, 132 insertions(+), 43 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.devcontainer/.docker/php/xdebug.ini b/.devcontainer/.docker/php/xdebug.ini index 6868b64..030f49d 100644 --- a/.devcontainer/.docker/php/xdebug.ini +++ b/.devcontainer/.docker/php/xdebug.ini @@ -6,42 +6,36 @@ error_log = /var/log/php-errors.log catch_workers_output = yes [xdebug] +# 'debug' means we're enabling step-by-step debugging +xdebug.mode=debug -; enables step by step debugging -; xdebug.mode=debug,develop -xdebug.mode=develop +xdebug.client_port=9003 -; xdebug.client_host=host.docker.internal +# xdebug.client_host is the IP address of the system where VS Code runs +# that IP address is DIFFERENT depending on WHERE VS Code is launched in (Windows/Mac, WSL(2), Container/devcontainer/codespaces) +# +# the PHP container sends debugging data OUT to xdebug.client_host:xdebug.client_port -; set this to 'yes' to ALWAYS start a request/ -; it will complain if not debugger is found listening -; default value is xdebug.start_with_request=trigger, which should be fine -; -; xdebug.start_with_request=yes -xdebug.discover_client_host=1 -xdebug.client_port=9003 +# localhost is used when running btoh VS Code and PHP from within **the same PHP container** +# after opening the project in the Container +xdebug.client_host=localhost + +# if using Docker Desktop 'host.docker.internal' is supposed to hold the IP Address of +# the Docker host, but that's not always true. DOUBLE-CHECK + +;xdebug.client_host=host.docker.internal + +# 'yes': This will always initiate a debugging, profiling, or tracing session as soon as a request is received, without needing any specific trigger +# 'no' : This will never initiate a session regardless of the presence of any trigger +# 'trigger' : This will initiate a session only if a specific trigger (like a GET/POST variable or a cookie) is present in the request. +xdebug.start_with_request=yes + +# OPTIONAL: idekey +# in the browser add a URL param (if not using a browser utility) +# url.to.debug?XDEBUG_SESSION_START=PHPSTORM +# sets up a coockie called "XDEBUG_SESSION_START" with the value "PHPSTORM", which is the "trigger" +# xdebug.idekey=PHPSTORM -; No need. By default, this is redirected to the general log of -; of your PHP container and visible from tools like Docker Desktop -; -;xdebug.log=/var/tmp/xdebug.log - -; Color var_dumps when in CLI -xdebug.cli_color=1 - -; redirect the xdebug log to the container's STDOUT (/proc/self/fd/1) or STDERR (/proc/self/fd/2) -xdebug.log=/tmp/xdebug.log - -; 2.x way to activate the debugger. -; generates this message, if not debugger is listening: -; NOTICE: PHP message: Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: host.docker.internal:9003 -; -; xdebug.idekey=PHPSTORM - -; NOTES -; -; the log error "Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION'" -; can be avoided by adding /?XDEBUG_SESSION=start to the page URL being browsed -; -; NOTICE: PHP message: Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: host.docker.internal:9003 \ No newline at end of file +# defines a log file. This is created (touch) and initialized (permissions) in the PHP container Dockerfile +xdebug.log=/tmp/xdebug.log \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c713bf7..c28cdf9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -31,7 +31,11 @@ // "xdebug.php-debug" = official XDEBUG extension "customizations": { "vscode": { - "extensions": ["xdebug.php-debug"] + "extensions": [ + "xdebug.php-debug" + ] } - } + }, + + "forwardPorts": [80] } \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index cefe387..4686d0e 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -40,6 +40,8 @@ services: # disk local-path volumes: - ${PHP_WEBROOT_HOST_PATH}:${PHP_WEBROOT_CONTAINER_PATH} + # we don't need to expose the port 9003 here for Xdebug because the + # connection comes from inside the PHP container to the IDE via port 9003 # MySQL Service diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..628f34b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,53 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003, + // ${workspaceFolder} == directory where /.vscode/ is + // the syntax is SERVER_PATH : LOCAL_PATH + "pathMappings": { + "/var/www/htdoc": "${workspaceFolder}/src" + } + }, + { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 0, + "runtimeArgs": [ + "-dxdebug.start_with_request=yes" + ], + "env": { + "XDEBUG_MODE": "debug,develop", + "XDEBUG_CONFIG": "client_port=${port}" + } + }, + { + "name": "Launch Built-in web server", + "type": "php", + "request": "launch", + "runtimeArgs": [ + "-dxdebug.mode=debug", + "-dxdebug.start_with_request=yes", + "-S", + "localhost:0" + ], + "program": "", + "cwd": "${workspaceRoot}", + "port": 9003, + "serverReadyAction": { + "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", + "uriFormat": "http://localhost:%s", + "action": "openExternally" + } + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 4976a56..a1bea66 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,20 @@ You'll need the following installed on your computer to follow along with this t The article mentions several ways to get a Laravel development environment up and running. +# Preparing the Laravel project to run + +## Dependencies + +In the Laravel project folder, install the Composer dependencies with the command + +`composer install` + ## .env file +Laravel uses the .env file for environment-specific configurations, like database credentials, application key, and other settings. Create one from the included example file: + +`cp .env.example .env` + #### Application key Laravel might ask to generate a new application key. You can do it by running this command in the laravel project folder. @@ -31,7 +43,37 @@ The complete URI looks like this: `DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority` -# Troubleshooting +# Xdebug + +The xdebug.php-debug VS Code extension is automatically installed if you launch via devcontainer.json. + +If you are using our container directly (docker compose up), or via VS Code (devcontainer), we suggest the following Xdebug configs visual studio + +### localhost + +The debug config file is located in `/.vscode/launch.json` + +```json +{ + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003, + "pathMappings": { + // ${workspaceFolder} == directory where /.vscode/ is + // the syntax is SERVER_PATH : LOCAL_PATH + "/var/www/htdoc": "${workspaceFolder}/src" + } +}, +``` + +### devcontainer + +- TODO + +### Codespaces + +- TODO # Disclaimer diff --git a/src/public/index.php b/src/public/index.php index b4a149b..93cf96f 100644 --- a/src/public/index.php +++ b/src/public/index.php @@ -1,9 +1,5 @@ make(Kernel::class); -// CRASH at the line below: - $response = $kernel->handle( $request = Request::capture() )->send(); From 9e661dfac99830597c29ca687cbf4ee4c1c0d065 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 30 Aug 2023 17:42:54 -0700 Subject: [PATCH 04/18] run composer if /vendor/ is not present modified the Dockerfile to run composer, if the /vendor/ directory is not present. src\init_repo.sh is executed when the instance is launched. There's a check to see if /vendor/ already exists removed ( ) characters from xdebug.ini as they generated some errors in the comments # characters should not be used for comments --- .devcontainer/.docker/php/Dockerfile | 17 +++++------- .devcontainer/.docker/php/xdebug.ini | 40 ++++++++++++++-------------- src/init_repo.sh | 16 +++++++++++ 3 files changed, 42 insertions(+), 31 deletions(-) create mode 100644 src/init_repo.sh diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile index 882ad27..28c1402 100644 --- a/.devcontainer/.docker/php/Dockerfile +++ b/.devcontainer/.docker/php/Dockerfile @@ -55,16 +55,11 @@ RUN curl -sS https://getcomposer.org/installer | php # copy composer to a place where it can be globally executed RUN mv composer.phar /usr/local/bin/composer -# NOT REQUIRED -# Change to non-root privilege -# USER www-data +# our repo is in var/www/htdoc +# COPY init_repo.sh /var/www/htdoc/ -# Enable Error-logging in the PHP container -# ---------------------------------------------------------- - -# RUN echo "error_log = /var/log/php-fpm.log" >> /usr/local/etc/php-fpm.d/docker.conf - -#RUN echo "php_admin_value[error_log] = /var/log/php-fpm/www-error.log" >> /usr/local/etc/php-fpm.d/www.conf && \ -# echo "php_admin_flag[log_errors] = on" >> /usr/local/etc/php-fpm.d/www.conf && \ -# echo "catch_workers_output = yes" >> /usr/local/etc/php-fpm.d/www.conf +# Set the working directory in the container +WORKDIR /var/www/htdoc +# start out script that runs composer install, but ONLY if /vendor/ does not exist +ENTRYPOINT ["/var/www/htdoc/init_repo.sh"] \ No newline at end of file diff --git a/.devcontainer/.docker/php/xdebug.ini b/.devcontainer/.docker/php/xdebug.ini index 030f49d..cdf2de0 100644 --- a/.devcontainer/.docker/php/xdebug.ini +++ b/.devcontainer/.docker/php/xdebug.ini @@ -1,41 +1,41 @@ -# already loaded in /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini -#zend_extension=xdebug +; already loaded in /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +;zend_extension=xdebug ; FIXME : should be elsewhere, like docker-php.ini error_log = /var/log/php-errors.log catch_workers_output = yes [xdebug] -# 'debug' means we're enabling step-by-step debugging +; 'debug' means we're enabling step-by-step debugging xdebug.mode=debug xdebug.client_port=9003 -# xdebug.client_host is the IP address of the system where VS Code runs -# that IP address is DIFFERENT depending on WHERE VS Code is launched in (Windows/Mac, WSL(2), Container/devcontainer/codespaces) -# -# the PHP container sends debugging data OUT to xdebug.client_host:xdebug.client_port +; xdebug.client_host is the IP address of the system where VS Code runs +; that IP address is DIFFERENT depending on WHERE VS Code is launched in Windows/Mac, WSL, Container/devcontainer/codespaces +; +; the PHP container sends debugging data OUT to xdebug.client_host:xdebug.client_port -# localhost is used when running btoh VS Code and PHP from within **the same PHP container** -# after opening the project in the Container +; localhost is used when running btoh VS Code and PHP from within **the same PHP container** +; after opening the project in the Container xdebug.client_host=localhost -# if using Docker Desktop 'host.docker.internal' is supposed to hold the IP Address of -# the Docker host, but that's not always true. DOUBLE-CHECK +; if using Docker Desktop 'host.docker.internal' is supposed to hold the IP Address of +; the Docker host, but that's not always true. DOUBLE-CHECK ;xdebug.client_host=host.docker.internal -# 'yes': This will always initiate a debugging, profiling, or tracing session as soon as a request is received, without needing any specific trigger -# 'no' : This will never initiate a session regardless of the presence of any trigger -# 'trigger' : This will initiate a session only if a specific trigger (like a GET/POST variable or a cookie) is present in the request. +; 'yes': This will always initiate a debugging, profiling, or tracing session as soon as a request is received, without needing any specific trigger +; 'no' : This will never initiate a session regardless of the presence of any trigger +; 'trigger' : This will initiate a session only if a specific trigger, like a GET/POST variable or a cookie, is present in the request. xdebug.start_with_request=yes -# OPTIONAL: idekey -# in the browser add a URL param (if not using a browser utility) -# url.to.debug?XDEBUG_SESSION_START=PHPSTORM -# sets up a coockie called "XDEBUG_SESSION_START" with the value "PHPSTORM", which is the "trigger" -# xdebug.idekey=PHPSTORM +; OPTIONAL: idekey +; in the browser add a URL param , if not using a browser utility +; url.to.debug?XDEBUG_SESSION_START=PHPSTORM +; sets up a coockie called "XDEBUG_SESSION_START" with the value "PHPSTORM", which is the "trigger" +; xdebug.idekey=PHPSTORM -# defines a log file. This is created (touch) and initialized (permissions) in the PHP container Dockerfile +; defines a log file. This is created, with touch, and initialized (permissions) in the PHP container Dockerfile xdebug.log=/tmp/xdebug.log \ No newline at end of file diff --git a/src/init_repo.sh b/src/init_repo.sh new file mode 100644 index 0000000..a1d5d5c --- /dev/null +++ b/src/init_repo.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Navigate to your application directory +cd /var/www/htdoc + +# displays the current path, for debugging +# pwd + +# Check if the vendor directory does not exist +if [ ! -d "vendor" ]; then + # Run composer install + composer install +fi + +# Then, execute the main command, e.g., starting PHP-FPM +exec php-fpm From 56b409385992d0354ca0b26f7a5699ba40a1d5c6 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 30 Aug 2023 21:59:19 -0700 Subject: [PATCH 05/18] Remove ENTRYPOINT as it seems to nuke Codespaces --- .devcontainer/.docker/php/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile index 28c1402..98b812b 100644 --- a/.devcontainer/.docker/php/Dockerfile +++ b/.devcontainer/.docker/php/Dockerfile @@ -62,4 +62,4 @@ RUN mv composer.phar /usr/local/bin/composer WORKDIR /var/www/htdoc # start out script that runs composer install, but ONLY if /vendor/ does not exist -ENTRYPOINT ["/var/www/htdoc/init_repo.sh"] \ No newline at end of file +#ENTRYPOINT ["/var/www/htdoc/init_repo.sh"] \ No newline at end of file From c49943408589e50a6df0c606cc682ab8fc14ccde Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 30 Aug 2023 22:54:38 -0700 Subject: [PATCH 06/18] Try initializing the repo with RUN ENDPOINT crashes CoseSpaces, it's been reported by several users Change the readme to remind people that Laravel does require some initializations edit .sh file to not lunch PHP-FPM after composer install --- .devcontainer/.docker/php/Dockerfile | 1 + README.md | 18 ++++++++++-------- src/init_repo.sh | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile index 98b812b..441f1f7 100644 --- a/.devcontainer/.docker/php/Dockerfile +++ b/.devcontainer/.docker/php/Dockerfile @@ -62,4 +62,5 @@ RUN mv composer.phar /usr/local/bin/composer WORKDIR /var/www/htdoc # start out script that runs composer install, but ONLY if /vendor/ does not exist +RUN chmod +x /var/www/htdoc/init_repo.sh #ENTRYPOINT ["/var/www/htdoc/init_repo.sh"] \ No newline at end of file diff --git a/README.md b/README.md index a1bea66..173b29f 100644 --- a/README.md +++ b/README.md @@ -15,33 +15,35 @@ The article mentions several ways to get a Laravel development environment up an # Preparing the Laravel project to run -## Dependencies +Before the project can run properly, we need to take several actions. + +## 1. Install dependencies In the Laravel project folder, install the Composer dependencies with the command `composer install` -## .env file +## 2. Create the .env file Laravel uses the .env file for environment-specific configurations, like database credentials, application key, and other settings. Create one from the included example file: `cp .env.example .env` -#### Application key +## 3. Generate a Laravel Application key Laravel might ask to generate a new application key. You can do it by running this command in the laravel project folder. `php artisan key:generate` -#### MongoDB connection string +## 4. Add the MongoDB connection string to .env -Not included in this repo is the Laravel .env file that contains the MongoDB connection string with the username / password. You'll have to make a cope of the .env.example file and add this variable: +We need to add the MongoDB connection string with the username / password to the .env file. add this line, but remember that your connection string might look different. -`DB_URI=` +`DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority` -The complete URI looks like this: +## 5. Ready! -`DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority` +Head to the site URL and you should see the Laravel Homepage # Xdebug diff --git a/src/init_repo.sh b/src/init_repo.sh index a1d5d5c..7c492b7 100644 --- a/src/init_repo.sh +++ b/src/init_repo.sh @@ -13,4 +13,4 @@ if [ ! -d "vendor" ]; then fi # Then, execute the main command, e.g., starting PHP-FPM -exec php-fpm +# exec php-fpm From 1350017fbd72ead6fc1af72bb1aa9bbb59044b6a Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 30 Aug 2023 23:06:24 -0700 Subject: [PATCH 07/18] Update Dockerfile don't try to run chmod in a mounted directory --- .devcontainer/.docker/php/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile index 441f1f7..cbcee9f 100644 --- a/.devcontainer/.docker/php/Dockerfile +++ b/.devcontainer/.docker/php/Dockerfile @@ -62,5 +62,6 @@ RUN mv composer.phar /usr/local/bin/composer WORKDIR /var/www/htdoc # start out script that runs composer install, but ONLY if /vendor/ does not exist -RUN chmod +x /var/www/htdoc/init_repo.sh +# WARNING: the commands below crash CodeSpaces. Not using for now. +#RUN chmod +x /var/www/htdoc/init_repo.sh #ENTRYPOINT ["/var/www/htdoc/init_repo.sh"] \ No newline at end of file From f066bcacb971d3be574799d96e2bccfe8c5bd548 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 30 Aug 2023 23:13:39 -0700 Subject: [PATCH 08/18] Update init_repo.sh add more automation to our post-install script --- src/init_repo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/init_repo.sh b/src/init_repo.sh index 7c492b7..5fef317 100644 --- a/src/init_repo.sh +++ b/src/init_repo.sh @@ -10,6 +10,8 @@ cd /var/www/htdoc if [ ! -d "vendor" ]; then # Run composer install composer install + cp .env.example .env + php artisan key:generate fi # Then, execute the main command, e.g., starting PHP-FPM From 1d3c2d0fdab75b8422d0b9eb25f1699058d042f6 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Thu, 31 Aug 2023 17:57:16 -0700 Subject: [PATCH 09/18] Update README.md Documented the Codespace launch process and generally improved the documentation. --- README.md | 101 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 173b29f..86891ba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # How To Build a Laravel + MongoDB Back End Service -This code was writting in conjunction with [this article](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/?utm_campaign=devrel). +This code was writting to accompany [this article](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/?utm_campaign=devrel). ## Prerequisites @@ -13,47 +13,85 @@ You'll need the following installed on your computer to follow along with this t The article mentions several ways to get a Laravel development environment up and running. -# Preparing the Laravel project to run +# 🚀 Launch this repo in CodeSpaces -Before the project can run properly, we need to take several actions. + -## 1. Install dependencies +⏳Codespaces will build the app's container(s). This may take **~3 minutes**. -In the Laravel project folder, install the Composer dependencies with the command + -`composer install` +✅Done! We now have our project running inside CodeSpaces. We can proceed to setting up Laravel -## 2. Create the .env file + -Laravel uses the .env file for environment-specific configurations, like database credentials, application key, and other settings. Create one from the included example file: +

-`cp .env.example .env` +# 👋 Before you run this Laravel app -## 3. Generate a Laravel Application key +## 1. Laravel setup -Laravel might ask to generate a new application key. You can do it by running this command in the laravel project folder. +After cloning the code repo or launching a Docker/CodeSpaces instance, the project needs a few more things before the Laravel App can run: -`php artisan key:generate` +1. install dependencies via Composer +2. create a new .env file +3. generate a new Laravel App Key -## 4. Add the MongoDB connection string to .env +You can conveniently do all three by running the `init_repo.sh` from the +PHP container. -We need to add the MongoDB connection string with the username / password to the .env file. add this line, but remember that your connection string might look different. + -`DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority` +The script will install the package via Composer, create an .env and create an App key. + + -## 5. Ready! +## 2. Ready! Head to the site URL and you should see the Laravel Homepage -# Xdebug + + +

+ + + +Our base Laravel app is ready 🥳. + +❗Note that this branch already has the Model and Migrations already setup. + + +**Next**, you can connect to a MongoDB Cluster and try some of the things we talked about in our [How To Build a Laravel + MongoDB Back End Service](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/) + +Add the MongoDB connection string with the username / password to the .env file. add this line, but remember that your connection string might look different. + +In .env, add + +`DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority` + +# 🚀 Launch locally with Docker + +Assuming that you already have Docker Desktop installed on Windows/Mac or Docker on Linux, + +- clone the repository to a local directory +- navigate to the ./devcontainer folder +- execute `docker compose up` +- in the PHP container, execute the init_repo.sh script + +Once the containe(s) are up, visit http://localhost + + +# Optional: Xdebug The xdebug.php-debug VS Code extension is automatically installed if you launch via devcontainer.json. -If you are using our container directly (docker compose up), or via VS Code (devcontainer), we suggest the following Xdebug configs visual studio +👀 **Important**: our `.devcontainer/.docker/php/xdebug.ini` file is setup by default with `xdebug.client_host=localhost`, which should works for **CodeSpaces** and Devcontainers. -### localhost +For **local development**, you need to replace `localhost` with the IP where your code IDE runs or a dns name that maps to it. That's because your PHP container and the IDE host tend to have different IPs. -The debug config file is located in `/.vscode/launch.json` +If you are using our container directly (docker compose up), or via VS Code (devcontainer), we suggest the following Xdebug configs visual studio. Note the difference in path mapping. + +## CodeSpaces and (inside a Devcontainer) ```json { @@ -62,21 +100,26 @@ The debug config file is located in `/.vscode/launch.json` "request": "launch", "port": 9003, "pathMappings": { - // ${workspaceFolder} == directory where /.vscode/ is - // the syntax is SERVER_PATH : LOCAL_PATH - "/var/www/htdoc": "${workspaceFolder}/src" + "/var/www/htdoc": "${workspaceFolder}" } }, ``` -### devcontainer - -- TODO - -### Codespaces +## local development with Docker -- TODO +The debug config file is located in `/.vscode/launch.json` +```json +{ + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003, + "pathMappings": { + "/var/www/htdoc": "${workspaceFolder}/src" + } +}, +``` # Disclaimer From 9572d8d3ce540661c44c81ca978de3d7ff487924 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Tue, 5 Sep 2023 21:45:05 -0700 Subject: [PATCH 10/18] Fix MySQL default connectivity Dockerfile - install 'default-mysql-client' PHP extension so we can log into MySQL from the PHP container if we want to interact with the database container from there. - install and enable the pdo_mysql PHP extension with 'docker-php-ext-install pdo_mysql' and 'docker-php-ext-enable pdo_mysql'. This is required for Laravel docker-compose.yml - MYSQL_USER and MYSQL_PASSWORD don't seem to do much as the user 'myuser' does not seem to be created. For now, we'll use root + rootpassword /src/.env.example - set all the default MySQL connectivity and login information so it works out of the box - add a default MONGODB_URI for people to replace with their ATLAS connection string config\database.php - change DB_URI to the standard MONGODB_URI we use in our drivers and everything else \routes\api.php - added a \api\test_mysql\ route to check if the MySQL connection works. It's a VERY basic test and does not check for the table, but we can improve this later. The table is created by our Docker config --- .devcontainer/.docker/php/Dockerfile | 9 ++++++--- .devcontainer/docker-compose.yml | 3 +-- src/.env.example | 12 +++++++----- src/config/database.php | 6 +++--- src/routes/api.php | 13 +++++++++++++ 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile index cbcee9f..b877e65 100644 --- a/.devcontainer/.docker/php/Dockerfile +++ b/.devcontainer/.docker/php/Dockerfile @@ -12,8 +12,9 @@ RUN touch /var/log/php-errors.log && chown www-data:www-data /var/log/php-errors # Update the packages # Install system packages required for MongoDB extension +# 'mysql-client' so we can log into mysql from the PHP container with the command 'mysql -h mysql -u root -p' where mysql is the service name RUN apt-get update \ - && apt-get install -y libssl-dev wget git unzip + && apt-get install -y libssl-dev wget git unzip default-mysql-client RUN pecl apt update \ && apt install libzip-dev -y \ @@ -21,7 +22,8 @@ RUN pecl apt update \ && rm -rf /var/lib/apt/lists/* # Required for MySQL to work in PHP -RUN docker-php-ext-install mysqli +RUN docker-php-ext-install mysqli && \ + docker-php-ext-install pdo_mysql # Test if already installed and # install the mongodb PHP extension @@ -38,7 +40,8 @@ RUN bash -c '[[ -n "$(pecl list | grep xdebug)" ]]\ # install Redis PHP driver RUN pecl install -o -f redis \ && rm -rf /tmp/pear \ -&& docker-php-ext-enable redis +&& docker-php-ext-enable redis \ +&& docker-php-ext-enable pdo_mysql # Task: copy rep's PHP .ini files to be automatically parsed # diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 4686d0e..9b6d097 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -43,14 +43,13 @@ services: # we don't need to expose the port 9003 here for Xdebug because the # connection comes from inside the PHP container to the IDE via port 9003 - # MySQL Service mysql: image: ${MYSQL_IMAGE} environment: MYSQL_ROOT_PASSWORD: rootpassword MYSQL_DATABASE: mydatabase - MYSQL_USER: rootuser + MYSQL_USER: myuser MYSQL_PASSWORD: mypassword volumes: # map local /data/ folder to container /var/lib/mysql for MySQL data persistence diff --git a/src/.env.example b/src/.env.example index 8510237..4126820 100644 --- a/src/.env.example +++ b/src/.env.example @@ -1,3 +1,5 @@ +MONGODB_URI=mongodb://127.0.0.1:27017/ # replace with your live MongoDB Atlas cluster! + APP_NAME=Laravel APP_ENV=local APP_KEY= @@ -8,12 +10,12 @@ LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 +DB_CONNECTION=mysql # this 'mysql' is the Laravel connection name +DB_HOST=mysql # this 'mysql' refers to the Docker environment's 'mysql' service in lieu of the IP. It is defined in the docker-compose.yml file DB_PORT=3306 -DB_DATABASE=laravel -DB_USERNAME=root -DB_PASSWORD= +DB_DATABASE=mydatabase # arbitrary database name for this project +DB_USERNAME=root # our docker MySQL root username and password, defined in docker-compose.yml +DB_PASSWORD=rootpassword BROADCAST_DRIVER=log CACHE_DRIVER=file diff --git a/src/config/database.php b/src/config/database.php index 052889d..e8db9bd 100644 --- a/src/config/database.php +++ b/src/config/database.php @@ -37,13 +37,13 @@ 'mongodb' => [ 'driver' => 'mongodb', - 'dsn' => env('DB_URI'), + 'dsn' => env('MONGODB_URI'), 'database' => 'bigsearch', // replace 'bigsearch' with your database name ], 'mongodb_mflix' => [ 'driver' => 'mongodb', - 'dsn' => env('DB_URI'), + 'dsn' => env('MONGODB_URI'), 'database' => 'sample_mflix', ], @@ -157,4 +157,4 @@ ], -]; +]; \ No newline at end of file diff --git a/src/routes/api.php b/src/routes/api.php index 070874d..58bab08 100644 --- a/src/routes/api.php +++ b/src/routes/api.php @@ -263,4 +263,17 @@ $result = DB::connection('mongodb')->getCollection('laracoll')->createIndex($indexKeys, $indexOptions); return ['status' => 'executed', 'data' => $result ]; +}); + + +/* + Laravel check on the MySQL connection +*/ +Route::get('/test_mysql/', function (Request $request) { + try { + DB::connection()->getPdo(); + return ['status' => 'executed', 'data' => 'Successfully connected to the DB.' ]; + } catch (\Exception $e) { + return ['status' => 'FAIL. exception', 'data' => $e ]; + } }); \ No newline at end of file From 5084a84dd5f12c21d88c9f3d1a12179754877dd6 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Tue, 5 Sep 2023 22:03:39 -0700 Subject: [PATCH 11/18] update devcontainer.json to execute our init .sh file --- .devcontainer/devcontainer.json | 9 ++++++++- src/routes/api.php | 25 ++++++++++++------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c28cdf9..6911479 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,6 @@ { + "name": "laravel9-mongodb-tutorial", + // Mandatory definition for .devcontainer // // which service AS DEFINED IN .devcontainer/docker-compose.yml @@ -10,6 +12,8 @@ // so we'll use a compose .yml file instead of defining the services in devcontainer.json "dockerComposeFile": "./docker-compose.yml", + "shutdownAction": "stopCompose", + // Mandatory definition for .devcontainer // // workspaceFolder describes the CONTAINER folder @@ -37,5 +41,8 @@ } }, - "forwardPorts": [80] + "forwardPorts": [80], + + // execute our one-time repo init if /vendor/ does not exist + "postCreateCommand": "sh init_repo.sh" } \ No newline at end of file diff --git a/src/routes/api.php b/src/routes/api.php index 58bab08..f676b21 100644 --- a/src/routes/api.php +++ b/src/routes/api.php @@ -52,6 +52,18 @@ return ['msg' => $msg]; }); +/* + Laravel check on the MySQL connection +*/ +Route::get('/test_mysql/', function (Request $request) { + try { + DB::connection()->getPdo(); + return ['status' => 'executed', 'data' => 'Successfully connected to the DB.' ]; + } catch (\Exception $e) { + return ['status' => 'FAIL. exception', 'data' => $e ]; + } +}); + /* Create a new "customer" in our SQL database This is just to show the code looks identical to the MongoDB version @@ -263,17 +275,4 @@ $result = DB::connection('mongodb')->getCollection('laracoll')->createIndex($indexKeys, $indexOptions); return ['status' => 'executed', 'data' => $result ]; -}); - - -/* - Laravel check on the MySQL connection -*/ -Route::get('/test_mysql/', function (Request $request) { - try { - DB::connection()->getPdo(); - return ['status' => 'executed', 'data' => 'Successfully connected to the DB.' ]; - } catch (\Exception $e) { - return ['status' => 'FAIL. exception', 'data' => $e ]; - } }); \ No newline at end of file From 210e6b2fd098a113bb8110ea904a327ee14338b7 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Tue, 5 Sep 2023 22:44:35 -0700 Subject: [PATCH 12/18] Update Dockerfile add the "ping" command to our PHP container. Convenient to debug stuff --- .devcontainer/.docker/php/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/.docker/php/Dockerfile b/.devcontainer/.docker/php/Dockerfile index b877e65..69265a0 100644 --- a/.devcontainer/.docker/php/Dockerfile +++ b/.devcontainer/.docker/php/Dockerfile @@ -13,8 +13,9 @@ RUN touch /var/log/php-errors.log && chown www-data:www-data /var/log/php-errors # Update the packages # Install system packages required for MongoDB extension # 'mysql-client' so we can log into mysql from the PHP container with the command 'mysql -h mysql -u root -p' where mysql is the service name +# 'iputils-ping' to get the ping command RUN apt-get update \ - && apt-get install -y libssl-dev wget git unzip default-mysql-client + && apt-get install -y libssl-dev wget git unzip default-mysql-client iputils-ping RUN pecl apt update \ && apt install libzip-dev -y \ From 4d7cb0b54120e70c5e3fcac0f1a28559bfd85682 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 6 Sep 2023 10:40:28 -0700 Subject: [PATCH 13/18] update container config to access mysql - added DATABASE_URL in the php service environment Hopefully, it will help us with accessing MySQL in Codespaces - open 3306 mysql port in devcontainer.json --- .devcontainer/devcontainer.json | 2 +- .devcontainer/docker-compose.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6911479..abf6dd2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -41,7 +41,7 @@ } }, - "forwardPorts": [80], + "forwardPorts": [80,3306], // execute our one-time repo init if /vendor/ does not exist "postCreateCommand": "sh init_repo.sh" diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 9b6d097..01e88a6 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -42,6 +42,10 @@ services: - ${PHP_WEBROOT_HOST_PATH}:${PHP_WEBROOT_CONTAINER_PATH} # we don't need to expose the port 9003 here for Xdebug because the # connection comes from inside the PHP container to the IDE via port 9003 + environment: + - DATABASE_URL=mysql://root:rootpassword@mysql:3306/mydatabase + depends_on: + - mysql # MySQL Service mysql: From f515d9af820b6fda4f05c4a311111258ad09daa6 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 6 Sep 2023 11:18:23 -0700 Subject: [PATCH 14/18] updated docker-compose and .env possible conflict in Laravel as there are TWO 'mysql' strings - Laravel MySQL database name - Docker 'mysql' service. Renaming the docker mysql service from 'mysql' to 'mysql_service' --- .devcontainer/.env | 3 +++ .devcontainer/docker-compose.yml | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.devcontainer/.env b/.devcontainer/.env index 4685237..4be31c2 100644 --- a/.devcontainer/.env +++ b/.devcontainer/.env @@ -18,6 +18,9 @@ MYSQL_DATA_CONTAINER_PATH=/var/lib/mysql MYSQL_HOST_PORT=3306 MYSQL_CONTAINER_PORT=3306 +MYSQL_ROOT_PASSWORD=rootpassword +MYSQL_DATABASE=mydatabase + PHP_IMAGE=php:8.2-fpm diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 01e88a6..4a5be75 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -25,7 +25,7 @@ services: - ${NGINX_HOST_CONFD_DIR}:${NGINX_CONTAINER_CONFD_DIR} depends_on: - php - - mysql + - mysql_service # PHP Service php: @@ -43,23 +43,27 @@ services: # we don't need to expose the port 9003 here for Xdebug because the # connection comes from inside the PHP container to the IDE via port 9003 environment: - - DATABASE_URL=mysql://root:rootpassword@mysql:3306/mydatabase + # laravel's default mysql config looks for the DATABASE_URL environment variable + - DATABASE_URL=mysql://root:${MYSQL_ROOT_PASSWORD}@mysql_service:3306/${MYSQL_DATABASE} depends_on: - - mysql + - mysql_service # MySQL Service - mysql: + mysql_service: image: ${MYSQL_IMAGE} environment: - MYSQL_ROOT_PASSWORD: rootpassword - MYSQL_DATABASE: mydatabase - MYSQL_USER: myuser - MYSQL_PASSWORD: mypassword + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_DATABASE: ${MYSQL_DATABASE} + + # the two variales below don't seem to be used at all. Commenting out for now + #MYSQL_USER: myuser + #MYSQL_PASSWORD: mypassword volumes: # map local /data/ folder to container /var/lib/mysql for MySQL data persistence - ${MYSQL_DATA_HOST_PATH}:${MYSQL_DATA_CONTAINER_PATH} ports: - - "${MYSQL_HOST_PORT}:${MYSQL_CONTAINER_PORT}" + - "3306:3306" + # host_port:container_port redis: From 00cb759293601dd49e05883e9b28159410d19ef7 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 6 Sep 2023 12:34:22 -0700 Subject: [PATCH 15/18] remove MySQL folder mount - suspecting that we're not supposed to mount the MySQL folder in the CodeSpaces environment. It looks like our MySQL fails to start for some reason. That's why the 'mysql_service' name does not DNS-resolve unlike 'php' or 'nginx' Let's try - also, port 3306 does not need to be exposed in devcontainer.json, unless we try to access it from the outside. --- .devcontainer/devcontainer.json | 2 +- .devcontainer/docker-compose.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index abf6dd2..6911479 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -41,7 +41,7 @@ } }, - "forwardPorts": [80,3306], + "forwardPorts": [80], // execute our one-time repo init if /vendor/ does not exist "postCreateCommand": "sh init_repo.sh" diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 4a5be75..21042b1 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -58,20 +58,20 @@ services: # the two variales below don't seem to be used at all. Commenting out for now #MYSQL_USER: myuser #MYSQL_PASSWORD: mypassword - volumes: + #volumes: # map local /data/ folder to container /var/lib/mysql for MySQL data persistence - - ${MYSQL_DATA_HOST_PATH}:${MYSQL_DATA_CONTAINER_PATH} + # - ${MYSQL_DATA_HOST_PATH}:${MYSQL_DATA_CONTAINER_PATH} ports: - "3306:3306" # host_port:container_port - redis: - image: redis:latest - ports: - - "6379:6379" - volumes: - - ${REDIS_DATA_HOST_PATH}:${REDIS_DATA_CONTAINER_PATH} +# redis: +# image: redis:latest +# ports: +# - "6379:6379" +# volumes: +# - ${REDIS_DATA_HOST_PATH}:${REDIS_DATA_CONTAINER_PATH} # Notes: # From 0651ac5f78e7cd1db338de7d645f3371cfe8fbad Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Wed, 6 Sep 2023 16:28:13 -0700 Subject: [PATCH 16/18] Update documentation and .env.example --- .devcontainer/docker-compose.yml | 7 +++- README.md | 57 ++++++++++++++++---------------- src/.env.example | 4 +-- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 21042b1..6f4bdf4 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -51,6 +51,7 @@ services: # MySQL Service mysql_service: image: ${MYSQL_IMAGE} + environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_DATABASE: ${MYSQL_DATABASE} @@ -58,12 +59,16 @@ services: # the two variales below don't seem to be used at all. Commenting out for now #MYSQL_USER: myuser #MYSQL_PASSWORD: mypassword + + # do NOT try mounting a volume in CodeSpaces as it will fail and MySQL will not launch (try pinging mysql_service) + # this is only useful when working locally on a website with a non-ephemeral database #volumes: # map local /data/ folder to container /var/lib/mysql for MySQL data persistence # - ${MYSQL_DATA_HOST_PATH}:${MYSQL_DATA_CONTAINER_PATH} + ports: - "3306:3306" - # host_port:container_port + # syntax = host_port:container_port # redis: diff --git a/README.md b/README.md index 86891ba..e6c4ec7 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ # How To Build a Laravel + MongoDB Back End Service -This code was writting to accompany [this article](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/?utm_campaign=devrel). +This code was written to accompany [this tutorial article](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/?utm_campaign=devrel). ## Prerequisites You'll need the following installed on your computer to follow along with this tutorial: - A MongoDB Atlas cluster - - [Create a free cluster](https://www.mongodb.com/try?utm_campaign=devrel) and [load the MongoDB sample data](https://www.mongodb.com/basics/sample-database?utm_campaign=devrel). -- A code editor of your choice. + - [Create a **free** cluster](https://www.mongodb.com/try?utm_campaign=devrel) and [load the MongoDB sample data](https://www.mongodb.com/basics/sample-database?utm_campaign=devrel). +- A GitHub account if you want to use GitHub Codespaces (a 1-click experience) +- A code editor of your choice for local development - We suggeest [Visual Studio Code](https://code.visualstudio.com/download). Check the optional [MongoDB for VS Code](https://www.mongodb.com/products/vs-code?utm_campaign=devrel) extension. The article mentions several ways to get a Laravel development environment up and running. @@ -29,45 +30,45 @@ The article mentions several ways to get a Laravel development environment up an # 👋 Before you run this Laravel app -## 1. Laravel setup +## 1. Final Laravel app setup -After cloning the code repo or launching a Docker/CodeSpaces instance, the project needs a few more things before the Laravel App can run: +After cloning the code repo or launching a Docker/CodeSpaces instance, a script called `init_repo.sh` will be automatically executed (as setup in devcontainer.json) to: -1. install dependencies via Composer -2. create a new .env file -3. generate a new Laravel App Key +- install dependencies via Composer +- create a new .env file +- generate a new Laravel App Key -You can conveniently do all three by running the `init_repo.sh` from the -PHP container. +1. All you need to do is to **add your MongoDB credentials in Laravel's .env file**, using the MONGODB_URI environment variable. Here's [how to get your credentials](https://www.mongodb.com/docs/guides/atlas/connection-string/?utm_campaign=devrel) It looks something like this: - +``` +MONGODB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority +``` -The script will install the package via Composer, create an .env and create an App key. +❗Note that this branch already has the Laravel Model and Migrations already created and ready, but the tables have been initialized yet. - +2. You can test your credentials by using the code's API endpoint -## 2. Ready! +``` +/api/ping/ +``` -Head to the site URL and you should see the Laravel Homepage +Find the site's root URL by going to the "Ports" tab and click on the globe icon of port 80 -

+3. If the MongoDB ping test worked, use this command in the terminal to initialize the tables - - -Our base Laravel app is ready 🥳. - -❗Note that this branch already has the Model and Migrations already setup. +`php artisan migrate:refresh` +

-**Next**, you can connect to a MongoDB Cluster and try some of the things we talked about in our [How To Build a Laravel + MongoDB Back End Service](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/) +## 2. Ready! -Add the MongoDB connection string with the username / password to the .env file. add this line, but remember that your connection string might look different. + -In .env, add +Our base Laravel app is ready 🥳. -`DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority` +**Next**, try some of the things we talked about in our [How To Build a Laravel + MongoDB Back End Service](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/) # 🚀 Launch locally with Docker @@ -76,10 +77,10 @@ Assuming that you already have Docker Desktop installed on Windows/Mac or Docker - clone the repository to a local directory - navigate to the ./devcontainer folder - execute `docker compose up` -- in the PHP container, execute the init_repo.sh script - -Once the containe(s) are up, visit http://localhost +- in the PHP container, execute `sh init_repo.sh` +- initialize your .env file as instructed above +Once the container(s) are up, visit http://localhost # Optional: Xdebug diff --git a/src/.env.example b/src/.env.example index 4126820..c565cf6 100644 --- a/src/.env.example +++ b/src/.env.example @@ -10,8 +10,8 @@ LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=mysql # this 'mysql' is the Laravel connection name -DB_HOST=mysql # this 'mysql' refers to the Docker environment's 'mysql' service in lieu of the IP. It is defined in the docker-compose.yml file +DB_CONNECTION=mysql # 'mysql' is the Laravel connection name defined in config/database/php +DB_HOST=mysql_service # 'mysql_service' refers to the Docker environment's 'mysql_service' container in lieu of the IP. It is defined in the docker-compose.yml file DB_PORT=3306 DB_DATABASE=mydatabase # arbitrary database name for this project DB_USERNAME=root # our docker MySQL root username and password, defined in docker-compose.yml From 93f62f5c884e974c06343b0c057b2f1dff3c1568 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Sun, 10 Sep 2023 17:16:02 -0700 Subject: [PATCH 17/18] Address feedback from internal review - use the new MongoDB-owned package name (mongodb/laravel-mongodb): OK! - rename /api/ping/ to /api/test_mongodb/ to be consisten with /test_mysql/ `php artisan migrate:refresh` works, after both databases are accessible Misc: init_repo.sh now launched automatically if using devcontainer, since it's defined in devcontainer.json --- src/composer.json | 2 +- src/composer.lock | 1017 ++++++++++++++++++++++++++------------------ src/routes/api.php | 16 +- 3 files changed, 615 insertions(+), 420 deletions(-) diff --git a/src/composer.json b/src/composer.json index 2adf360..9c8a338 100644 --- a/src/composer.json +++ b/src/composer.json @@ -8,7 +8,7 @@ "php": "^8.0", "fruitcake/laravel-cors": "^2.0.5", "guzzlehttp/guzzle": "^7.2", - "jenssegers/mongodb": "^3.9", + "mongodb/laravel-mongodb": "^3.9", "laravel/framework": "^9.0", "laravel/sanctum": "^2.14", "laravel/tinker": "^2.7" diff --git a/src/composer.lock b/src/composer.lock index 775e1d4..5df67d0 100644 --- a/src/composer.lock +++ b/src/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": "bcdef9568d8d94356f3e0bd1a33967df", + "content-hash": "6f72551018c3a6355184497bd345575f", "packages": [ { "name": "asm89/stack-cors", @@ -362,16 +362,16 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", + "version": "v3.3.3", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", "shasum": "" }, "require": { @@ -411,7 +411,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3" }, "funding": [ { @@ -419,7 +419,7 @@ "type": "github" } ], - "time": "2022-09-10T18:51:20+00:00" + "time": "2023-08-10T19:36:49+00:00" }, { "name": "egulias/email-validator", @@ -703,22 +703,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.7.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -809,7 +809,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.7.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -825,20 +825,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T14:04:53+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { @@ -892,7 +892,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.0" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -908,20 +908,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T13:50:22+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { @@ -1008,7 +1008,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -1024,20 +1024,20 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2023-08-27T10:13:57+00:00" }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2" + "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/b945d74a55a25a949158444f09ec0d3c120d69e2", - "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/61bf437fc2197f587f6857d3ff903a24f1731b5d", + "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d", "shasum": "" }, "require": { @@ -1045,15 +1045,11 @@ "symfony/polyfill-php80": "^1.17" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", "phpunit/phpunit": "^8.5.19 || ^9.5.8", "uri-template/tests": "1.0.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { "GuzzleHttp\\UriTemplate\\": "src" @@ -1092,7 +1088,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.1" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.2" }, "funding": [ { @@ -1108,7 +1104,7 @@ "type": "tidelift" } ], - "time": "2021-10-07T12:57:01+00:00" + "time": "2023-08-27T10:19:19+00:00" }, { "name": "jean85/pretty-package-versions", @@ -1169,100 +1165,18 @@ }, "time": "2021-10-08T21:21:46+00:00" }, - { - "name": "jenssegers/mongodb", - "version": "v3.9.5", - "source": { - "type": "git", - "url": "https://github.com/jenssegers/laravel-mongodb.git", - "reference": "6ce35ace85a5946f943d7f493f93aebb9a6d129d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jenssegers/laravel-mongodb/zipball/6ce35ace85a5946f943d7f493f93aebb9a6d129d", - "reference": "6ce35ace85a5946f943d7f493f93aebb9a6d129d", - "shasum": "" - }, - "require": { - "illuminate/container": "^9.0", - "illuminate/database": "^9.0", - "illuminate/events": "^9.0", - "illuminate/support": "^9.0", - "mongodb/mongodb": "^1.11" - }, - "require-dev": { - "doctrine/dbal": "^2.13.3|^3.1.4", - "mockery/mockery": "^1.3.1", - "orchestra/testbench": "^7.0", - "phpunit/phpunit": "^9.5.8" - }, - "suggest": { - "jenssegers/mongodb-sentry": "Add Sentry support to Laravel-MongoDB", - "jenssegers/mongodb-session": "Add MongoDB session support to Laravel-MongoDB" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Jenssegers\\Mongodb\\MongodbServiceProvider", - "Jenssegers\\Mongodb\\MongodbQueueServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Jenssegers\\Mongodb\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jens Segers", - "homepage": "https://jenssegers.com" - } - ], - "description": "A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)", - "homepage": "https://github.com/jenssegers/laravel-mongodb", - "keywords": [ - "database", - "eloquent", - "laravel", - "model", - "moloquent", - "mongo", - "mongodb" - ], - "support": { - "issues": "https://github.com/jenssegers/laravel-mongodb/issues", - "source": "https://github.com/jenssegers/laravel-mongodb/tree/v3.9.5" - }, - "funding": [ - { - "url": "https://github.com/jenssegers", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/jenssegers/mongodb", - "type": "tidelift" - } - ], - "time": "2023-02-16T12:20:36+00:00" - }, { "name": "laravel/framework", - "version": "v9.52.10", + "version": "v9.52.15", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "858add225ce88a76c43aec0e7866288321ee0ee9" + "reference": "e3350e87a52346af9cc655a3012d2175d2d05ad7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/858add225ce88a76c43aec0e7866288321ee0ee9", - "reference": "858add225ce88a76c43aec0e7866288321ee0ee9", + "url": "https://api.github.com/repos/laravel/framework/zipball/e3350e87a52346af9cc655a3012d2175d2d05ad7", + "reference": "e3350e87a52346af9cc655a3012d2175d2d05ad7", "shasum": "" }, "require": { @@ -1447,7 +1361,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-06-27T13:25:54+00:00" + "time": "2023-08-08T14:28:40+00:00" }, { "name": "laravel/sanctum", @@ -1516,16 +1430,16 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" + "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902", + "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902", "shasum": "" }, "require": { @@ -1572,20 +1486,20 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2023-01-30T18:31:20+00:00" + "time": "2023-07-14T13:56:28+00:00" }, { "name": "laravel/tinker", - "version": "v2.8.1", + "version": "v2.8.2", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "04a2d3bd0d650c0764f70bf49d1ee39393e4eb10" + "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/04a2d3bd0d650c0764f70bf49d1ee39393e4eb10", - "reference": "04a2d3bd0d650c0764f70bf49d1ee39393e4eb10", + "url": "https://api.github.com/repos/laravel/tinker/zipball/b936d415b252b499e8c3b1f795cd4fc20f57e1f3", + "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3", "shasum": "" }, "require": { @@ -1598,6 +1512,7 @@ }, "require-dev": { "mockery/mockery": "~1.3.3|^1.4.2", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^8.5.8|^9.3.3" }, "suggest": { @@ -1638,22 +1553,22 @@ ], "support": { "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/v2.8.1" + "source": "https://github.com/laravel/tinker/tree/v2.8.2" }, - "time": "2023-02-15T16:40:09+00:00" + "time": "2023-08-15T14:27:00+00:00" }, { "name": "league/commonmark", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048" + "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d44a24690f16b8c1808bf13b1bd54ae4c63ea048", - "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/3669d6d5f7a47a93c08ddff335e6d945481a1dd5", + "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5", "shasum": "" }, "require": { @@ -1746,7 +1661,7 @@ "type": "tidelift" } ], - "time": "2023-03-24T15:16:10+00:00" + "time": "2023-08-30T16:55:00+00:00" }, { "name": "league/config", @@ -1832,16 +1747,16 @@ }, { "name": "league/flysystem", - "version": "3.15.1", + "version": "3.16.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a141d430414fcb8bf797a18716b09f759a385bed" + "reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a141d430414fcb8bf797a18716b09f759a385bed", - "reference": "a141d430414fcb8bf797a18716b09f759a385bed", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fdf372ca6b63c6e281b1c01a624349ccb757729", + "reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729", "shasum": "" }, "require": { @@ -1850,6 +1765,8 @@ "php": "^8.0.2" }, "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", "aws/aws-sdk-php": "3.209.31 || 3.210.0", "guzzlehttp/guzzle": "<7.0", "guzzlehttp/ringphp": "<1.1.1", @@ -1869,7 +1786,7 @@ "microsoft/azure-storage-blob": "^1.1", "phpseclib/phpseclib": "^3.0.14", "phpstan/phpstan": "^0.12.26", - "phpunit/phpunit": "^9.5.11", + "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.3.1" }, "type": "library", @@ -1904,7 +1821,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.15.1" + "source": "https://github.com/thephpleague/flysystem/tree/3.16.0" }, "funding": [ { @@ -1916,20 +1833,20 @@ "type": "github" } ], - "time": "2023-05-04T09:04:26+00:00" + "time": "2023-09-07T19:22:17+00:00" }, { "name": "league/flysystem-local", - "version": "3.15.0", + "version": "3.16.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "543f64c397fefdf9cfeac443ffb6beff602796b3" + "reference": "ec7383f25642e6fd4bb0c9554fc2311245391781" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/543f64c397fefdf9cfeac443ffb6beff602796b3", - "reference": "543f64c397fefdf9cfeac443ffb6beff602796b3", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/ec7383f25642e6fd4bb0c9554fc2311245391781", + "reference": "ec7383f25642e6fd4bb0c9554fc2311245391781", "shasum": "" }, "require": { @@ -1964,7 +1881,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-local/issues", - "source": "https://github.com/thephpleague/flysystem-local/tree/3.15.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.16.0" }, "funding": [ { @@ -1976,30 +1893,30 @@ "type": "github" } ], - "time": "2023-05-02T20:02:14+00:00" + "time": "2023-08-30T10:23:59+00:00" }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/a6dfb1194a2946fcdc1f38219445234f65b35c96", + "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -2020,7 +1937,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.13.0" }, "funding": [ { @@ -2032,39 +1949,111 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2023-08-05T12:09:49+00:00" + }, + { + "name": "mongodb/laravel-mongodb", + "version": "v3.9.5", + "source": { + "type": "git", + "url": "git@github.com:mongodb/laravel-mongodb.git", + "reference": "6ce35ace85a5946f943d7f493f93aebb9a6d129d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mongodb/laravel-mongodb/zipball/6ce35ace85a5946f943d7f493f93aebb9a6d129d", + "reference": "6ce35ace85a5946f943d7f493f93aebb9a6d129d", + "shasum": "" + }, + "require": { + "illuminate/container": "^9.0", + "illuminate/database": "^9.0", + "illuminate/events": "^9.0", + "illuminate/support": "^9.0", + "mongodb/mongodb": "^1.11" + }, + "require-dev": { + "doctrine/dbal": "^2.13.3|^3.1.4", + "mockery/mockery": "^1.3.1", + "orchestra/testbench": "^7.0", + "phpunit/phpunit": "^9.5.8" + }, + "suggest": { + "jenssegers/mongodb-sentry": "Add Sentry support to Laravel-MongoDB", + "jenssegers/mongodb-session": "Add MongoDB session support to Laravel-MongoDB" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Jenssegers\\Mongodb\\MongodbServiceProvider", + "Jenssegers\\Mongodb\\MongodbQueueServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Jenssegers\\Mongodb\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jens Segers", + "homepage": "https://jenssegers.com" + } + ], + "description": "A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)", + "homepage": "https://github.com/jenssegers/laravel-mongodb", + "keywords": [ + "database", + "eloquent", + "laravel", + "model", + "moloquent", + "mongo", + "mongodb" + ], + "time": "2023-02-16T12:20:36+00:00" }, { "name": "mongodb/mongodb", - "version": "1.12.0", + "version": "1.16.0", "source": { "type": "git", "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "e4a7594ac4b31635fa77455c4038a7013024ba28" + "reference": "d4cdf057a67cb99a32db8984a16959bfa7ca7eb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/e4a7594ac4b31635fa77455c4038a7013024ba28", - "reference": "e4a7594ac4b31635fa77455c4038a7013024ba28", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/d4cdf057a67cb99a32db8984a16959bfa7ca7eb5", + "reference": "d4cdf057a67cb99a32db8984a16959bfa7ca7eb5", "shasum": "" }, "require": { "ext-hash": "*", "ext-json": "*", - "ext-mongodb": "^1.13.0", - "jean85/pretty-package-versions": "^1.2 || ^2.0.1", + "ext-mongodb": "^1.16.0", + "jean85/pretty-package-versions": "^2.0.1", "php": "^7.2 || ^8.0", - "symfony/polyfill-php80": "^1.19" + "symfony/polyfill-php73": "^1.27", + "symfony/polyfill-php80": "^1.27", + "symfony/polyfill-php81": "^1.27" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "squizlabs/php_codesniffer": "^3.6", - "symfony/phpunit-bridge": "^5.2" + "doctrine/coding-standard": "^11.1", + "rector/rector": "^0.16.0", + "squizlabs/php_codesniffer": "^3.7", + "symfony/phpunit-bridge": "^5.2", + "vimeo/psalm": "^4.28" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12.x-dev" + "dev-master": "1.16.x-dev" } }, "autoload": { @@ -2099,9 +2088,9 @@ ], "support": { "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/1.12.0" + "source": "https://github.com/mongodb/mongo-php-library/tree/1.16.0" }, - "time": "2022-03-23T20:18:39+00:00" + "time": "2023-06-22T11:04:04+00:00" }, { "name": "monolog/monolog", @@ -2207,25 +2196,29 @@ }, { "name": "nesbot/carbon", - "version": "2.68.1", + "version": "2.70.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da" + "reference": "d3298b38ea8612e5f77d38d1a99438e42f70341d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4f991ed2a403c85efbc4f23eb4030063fdbe01da", - "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d3298b38ea8612e5f77d38d1a99438e42f70341d", + "reference": "d3298b38ea8612e5f77d38d1a99438e42f70341d", "shasum": "" }, "require": { "ext-json": "*", "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, + "provide": { + "psr/clock-implementation": "1.0" + }, "require-dev": { "doctrine/dbal": "^2.0 || ^3.1.4", "doctrine/orm": "^2.7", @@ -2305,25 +2298,25 @@ "type": "tidelift" } ], - "time": "2023-06-20T18:29:04+00:00" + "time": "2023-09-07T16:43:50+00:00" }, { "name": "nette/schema", - "version": "v1.2.3", + "version": "v1.2.4", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" + "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab", + "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab", "shasum": "" }, "require": { "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.3" + "php": "7.1 - 8.3" }, "require-dev": { "nette/tester": "^2.3 || ^2.4", @@ -2365,26 +2358,26 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.3" + "source": "https://github.com/nette/schema/tree/v1.2.4" }, - "time": "2022-10-13T01:24:26+00:00" + "time": "2023-08-05T18:56:25+00:00" }, { "name": "nette/utils", - "version": "v4.0.0", + "version": "v4.0.1", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e" + "reference": "9124157137da01b1f5a5a22d6486cb975f26db7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e", + "url": "https://api.github.com/repos/nette/utils/zipball/9124157137da01b1f5a5a22d6486cb975f26db7e", + "reference": "9124157137da01b1f5a5a22d6486cb975f26db7e", "shasum": "" }, "require": { - "php": ">=8.0 <8.3" + "php": ">=8.0 <8.4" }, "conflict": { "nette/finder": "<3", @@ -2392,7 +2385,7 @@ }, "require-dev": { "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", + "nette/tester": "^2.5", "phpstan/phpstan": "^1.0", "tracy/tracy": "^2.9" }, @@ -2452,22 +2445,22 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.0" + "source": "https://github.com/nette/utils/tree/v4.0.1" }, - "time": "2023-02-02T10:41:53+00:00" + "time": "2023-07-30T15:42:21+00:00" }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -2508,9 +2501,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "nunomaduro/termwind", @@ -2673,6 +2666,54 @@ ], "time": "2023-02-25T19:38:58+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", @@ -3039,16 +3080,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.19", + "version": "v0.11.20", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "1724ceff278daeeac5a006744633bacbb2dc4706" + "reference": "0fa27040553d1d280a67a4393194df5228afea5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/1724ceff278daeeac5a006744633bacbb2dc4706", - "reference": "1724ceff278daeeac5a006744633bacbb2dc4706", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/0fa27040553d1d280a67a4393194df5228afea5b", + "reference": "0fa27040553d1d280a67a4393194df5228afea5b", "shasum": "" }, "require": { @@ -3109,9 +3150,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.19" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.20" }, - "time": "2023-07-15T19:42:19+00:00" + "time": "2023-07-31T14:32:22+00:00" }, { "name": "ralouphie/getallheaders", @@ -3340,16 +3381,16 @@ }, { "name": "symfony/console", - "version": "v6.3.0", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7" + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", - "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", "shasum": "" }, "require": { @@ -3410,7 +3451,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.0" + "source": "https://github.com/symfony/console/tree/v6.3.4" }, "funding": [ { @@ -3426,20 +3467,20 @@ "type": "tidelift" } ], - "time": "2023-05-29T12:49:39+00:00" + "time": "2023-08-16T10:10:12+00:00" }, { "name": "symfony/css-selector", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf" + "reference": "883d961421ab1709877c10ac99451632a3d6fa57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/883d961421ab1709877c10ac99451632a3d6fa57", + "reference": "883d961421ab1709877c10ac99451632a3d6fa57", "shasum": "" }, "require": { @@ -3475,7 +3516,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.3.0" + "source": "https://github.com/symfony/css-selector/tree/v6.3.2" }, "funding": [ { @@ -3491,7 +3532,7 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:43:42+00:00" + "time": "2023-07-12T16:00:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3562,16 +3603,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "99d2d814a6351461af350ead4d963bd67451236f" + "reference": "85fd65ed295c4078367c784e8a5a6cee30348b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/99d2d814a6351461af350ead4d963bd67451236f", - "reference": "99d2d814a6351461af350ead4d963bd67451236f", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/85fd65ed295c4078367c784e8a5a6cee30348b7a", + "reference": "85fd65ed295c4078367c784e8a5a6cee30348b7a", "shasum": "" }, "require": { @@ -3616,7 +3657,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.3.0" + "source": "https://github.com/symfony/error-handler/tree/v6.3.2" }, "funding": [ { @@ -3632,20 +3673,20 @@ "type": "tidelift" } ], - "time": "2023-05-10T12:03:13+00:00" + "time": "2023-07-16T17:05:46+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa" + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", - "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", "shasum": "" }, "require": { @@ -3696,7 +3737,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2" }, "funding": [ { @@ -3712,7 +3753,7 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2023-07-06T06:56:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3792,16 +3833,16 @@ }, { "name": "symfony/finder", - "version": "v6.3.0", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2" + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2", - "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2", + "url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e", + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e", "shasum": "" }, "require": { @@ -3836,7 +3877,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.0" + "source": "https://github.com/symfony/finder/tree/v6.3.3" }, "funding": [ { @@ -3852,20 +3893,20 @@ "type": "tidelift" } ], - "time": "2023-04-02T01:25:41+00:00" + "time": "2023-07-31T08:31:44+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.3.1", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66" + "reference": "cac1556fdfdf6719668181974104e6fcfa60e844" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e0ad0d153e1c20069250986cd9e9dd1ccebb0d66", - "reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cac1556fdfdf6719668181974104e6fcfa60e844", + "reference": "cac1556fdfdf6719668181974104e6fcfa60e844", "shasum": "" }, "require": { @@ -3913,7 +3954,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.1" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.4" }, "funding": [ { @@ -3929,20 +3970,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2023-08-22T08:20:46+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.1", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374" + "reference": "36abb425b4af863ae1fe54d8a8b8b4c76a2bccdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/161e16fd2e35fb4881a43bc8b383dfd5be4ac374", - "reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/36abb425b4af863ae1fe54d8a8b8b4c76a2bccdb", + "reference": "36abb425b4af863ae1fe54d8a8b8b4c76a2bccdb", "shasum": "" }, "require": { @@ -3951,7 +3992,7 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.3", "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^6.2.7", + "symfony/http-foundation": "^6.3.4", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -3959,7 +4000,7 @@ "symfony/cache": "<5.4", "symfony/config": "<6.1", "symfony/console": "<5.4", - "symfony/dependency-injection": "<6.3", + "symfony/dependency-injection": "<6.3.4", "symfony/doctrine-bridge": "<5.4", "symfony/form": "<5.4", "symfony/http-client": "<5.4", @@ -3983,7 +4024,7 @@ "symfony/config": "^6.1", "symfony/console": "^5.4|^6.0", "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^6.3", + "symfony/dependency-injection": "^6.3.4", "symfony/dom-crawler": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/finder": "^5.4|^6.0", @@ -4026,7 +4067,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.1" + "source": "https://github.com/symfony/http-kernel/tree/v6.3.4" }, "funding": [ { @@ -4042,7 +4083,7 @@ "type": "tidelift" } ], - "time": "2023-06-26T06:07:32+00:00" + "time": "2023-08-26T13:54:49+00:00" }, { "name": "symfony/mailer", @@ -4126,20 +4167,21 @@ }, { "name": "symfony/mime", - "version": "v6.3.0", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "7b5d2121858cd6efbed778abce9cfdd7ab1f62ad" + "reference": "9a0cbd52baa5ba5a5b1f0cacc59466f194730f98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/7b5d2121858cd6efbed778abce9cfdd7ab1f62ad", - "reference": "7b5d2121858cd6efbed778abce9cfdd7ab1f62ad", + "url": "https://api.github.com/repos/symfony/mime/zipball/9a0cbd52baa5ba5a5b1f0cacc59466f194730f98", + "reference": "9a0cbd52baa5ba5a5b1f0cacc59466f194730f98", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, @@ -4148,7 +4190,7 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<5.4", - "symfony/serializer": "<6.2" + "symfony/serializer": "<6.2.13|>=6.3,<6.3.2" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", @@ -4157,7 +4199,7 @@ "symfony/dependency-injection": "^5.4|^6.0", "symfony/property-access": "^5.4|^6.0", "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^6.2" + "symfony/serializer": "~6.2.13|^6.3.2" }, "type": "library", "autoload": { @@ -4189,7 +4231,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.3.0" + "source": "https://github.com/symfony/mime/tree/v6.3.3" }, "funding": [ { @@ -4205,20 +4247,20 @@ "type": "tidelift" } ], - "time": "2023-04-28T15:57:00+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -4233,7 +4275,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4271,7 +4313,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -4287,20 +4329,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -4312,7 +4354,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4352,7 +4394,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -4368,20 +4410,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/ecaafce9f77234a6a449d29e49267ba10499116d", + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d", "shasum": "" }, "require": { @@ -4395,7 +4437,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4439,7 +4481,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.28.0" }, "funding": [ { @@ -4455,20 +4497,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:30:37+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -4480,7 +4522,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4523,7 +4565,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -4539,20 +4581,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -4567,7 +4609,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4606,7 +4648,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -4622,20 +4664,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/70f4aebd92afca2f865444d30a4d2151c13c3179", + "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179", "shasum": "" }, "require": { @@ -4644,7 +4686,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4682,7 +4724,86 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-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.28.0" }, "funding": [ { @@ -4698,20 +4819,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -4720,7 +4841,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4765,7 +4886,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -4781,20 +4902,99 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "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 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57" + "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/508c652ba3ccf69f8c97f251534f229791b52a57", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", + "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", "shasum": "" }, "require": { @@ -4804,7 +5004,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4817,7 +5017,10 @@ ], "psr-4": { "Symfony\\Polyfill\\Php83\\": "" - } + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4842,7 +5045,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.28.0" }, "funding": [ { @@ -4858,20 +5061,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-08-16T06:22:46+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166" + "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/f3cf1a645c2734236ed1e2e671e273eeb3586166", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9c44518a5aff8da565c8a55dbe85d2769e6f630e", + "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e", "shasum": "" }, "require": { @@ -4886,7 +5089,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4924,7 +5127,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.28.0" }, "funding": [ { @@ -4940,20 +5143,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v6.3.0", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628" + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8741e3ed7fe2e91ec099e02446fb86667a0f1628", - "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628", + "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", "shasum": "" }, "require": { @@ -4985,7 +5188,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.3.0" + "source": "https://github.com/symfony/process/tree/v6.3.4" }, "funding": [ { @@ -5001,24 +5204,25 @@ "type": "tidelift" } ], - "time": "2023-05-19T08:06:44+00:00" + "time": "2023-08-07T10:39:22+00:00" }, { "name": "symfony/routing", - "version": "v6.3.1", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5" + "reference": "e7243039ab663822ff134fbc46099b5fdfa16f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/d37ad1779c38b8eb71996d17dc13030dcb7f9cf5", - "reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5", + "url": "https://api.github.com/repos/symfony/routing/zipball/e7243039ab663822ff134fbc46099b5fdfa16f6a", + "reference": "e7243039ab663822ff134fbc46099b5fdfa16f6a", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "doctrine/annotations": "<1.12", @@ -5067,7 +5271,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.3.1" + "source": "https://github.com/symfony/routing/tree/v6.3.3" }, "funding": [ { @@ -5083,7 +5287,7 @@ "type": "tidelift" } ], - "time": "2023-06-05T15:30:22+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "symfony/service-contracts", @@ -5169,16 +5373,16 @@ }, { "name": "symfony/string", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + "reference": "53d1a83225002635bca3482fcbf963001313fb68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", + "reference": "53d1a83225002635bca3482fcbf963001313fb68", "shasum": "" }, "require": { @@ -5235,7 +5439,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.0" + "source": "https://github.com/symfony/string/tree/v6.3.2" }, "funding": [ { @@ -5251,24 +5455,25 @@ "type": "tidelift" } ], - "time": "2023-03-21T21:06:29+00:00" + "time": "2023-07-05T08:41:27+00:00" }, { "name": "symfony/translation", - "version": "v6.3.0", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f72b2cba8f79dd9d536f534f76874b58ad37876f" + "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f72b2cba8f79dd9d536f534f76874b58ad37876f", - "reference": "f72b2cba8f79dd9d536f534f76874b58ad37876f", + "url": "https://api.github.com/repos/symfony/translation/zipball/3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", + "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.5|^3.0" }, @@ -5329,7 +5534,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.3.0" + "source": "https://github.com/symfony/translation/tree/v6.3.3" }, "funding": [ { @@ -5345,7 +5550,7 @@ "type": "tidelift" } ], - "time": "2023-05-19T12:46:45+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "symfony/translation-contracts", @@ -5501,20 +5706,21 @@ }, { "name": "symfony/var-dumper", - "version": "v6.3.1", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c81268d6960ddb47af17391a27d222bd58cf0515" + "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c81268d6960ddb47af17391a27d222bd58cf0515", - "reference": "c81268d6960ddb47af17391a27d222bd58cf0515", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2027be14f8ae8eae999ceadebcda5b4909b81d45", + "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -5523,6 +5729,7 @@ "require-dev": { "ext-iconv": "*", "symfony/console": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" @@ -5563,7 +5770,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.1" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.4" }, "funding": [ { @@ -5579,7 +5786,7 @@ "type": "tidelift" } ], - "time": "2023-06-21T12:08:28+00:00" + "time": "2023-08-24T14:51:05+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -6114,16 +6321,16 @@ }, { "name": "laravel/sail", - "version": "v1.23.3", + "version": "v1.24.1", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "e5536ac1df10eacd72a6569dc1b0db49b9ddbb85" + "reference": "3a373bb2845623aed2017c672dc61c84ae974890" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/e5536ac1df10eacd72a6569dc1b0db49b9ddbb85", - "reference": "e5536ac1df10eacd72a6569dc1b0db49b9ddbb85", + "url": "https://api.github.com/repos/laravel/sail/zipball/3a373bb2845623aed2017c672dc61c84ae974890", + "reference": "3a373bb2845623aed2017c672dc61c84ae974890", "shasum": "" }, "require": { @@ -6175,35 +6382,35 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2023-08-14T14:22:21+00:00" + "time": "2023-09-01T14:05:17+00:00" }, { "name": "mockery/mockery", - "version": "1.6.4", + "version": "1.6.6", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "d1413755e26fe56a63455f7753221c86cbb88f66" + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/d1413755e26fe56a63455f7753221c86cbb88f66", - "reference": "d1413755e26fe56a63455f7753221c86cbb88f66", + "url": "https://api.github.com/repos/mockery/mockery/zipball/b8e0bb7d8c604046539c1115994632c74dcb361e", + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": ">=7.4,<8.3" + "php": ">=7.3" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3", + "phpunit/phpunit": "^8.5 || ^9.6.10", "psalm/plugin-phpunit": "^0.18.4", "symplify/easy-coding-standard": "^11.5.0", - "vimeo/psalm": "^5.13.1" + "vimeo/psalm": "^4.30" }, "type": "library", "autoload": { @@ -6260,7 +6467,7 @@ "security": "https://github.com/mockery/mockery/security/advisories", "source": "https://github.com/mockery/mockery" }, - "time": "2023-07-19T15:51:02+00:00" + "time": "2023-08-09T00:03:52+00:00" }, { "name": "myclabs/deep-copy", @@ -6522,16 +6729,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "9.2.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", + "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", "shasum": "" }, "require": { @@ -6587,7 +6794,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" }, "funding": [ { @@ -6595,7 +6803,7 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-07-26T13:44:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6840,16 +7048,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.10", + "version": "9.6.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328" + "reference": "810500e92855eba8a7a5319ae913be2da6f957b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6d351645c3fe5a30f5e86be6577d946af65a328", - "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/810500e92855eba8a7a5319ae913be2da6f957b0", + "reference": "810500e92855eba8a7a5319ae913be2da6f957b0", "shasum": "" }, "require": { @@ -6923,7 +7131,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.10" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.11" }, "funding": [ { @@ -6939,7 +7147,7 @@ "type": "tidelift" } ], - "time": "2023-07-10T04:04:23+00:00" + "time": "2023-08-19T07:10:56+00:00" }, { "name": "sebastian/cli-parser", @@ -7447,16 +7655,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -7499,7 +7707,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" }, "funding": [ { @@ -7507,7 +7715,7 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code", @@ -7969,16 +8177,16 @@ }, { "name": "spatie/flare-client-php", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/spatie/flare-client-php.git", - "reference": "943894c6a6b00501365ac0b91ae0dce56f2226fa" + "reference": "5f2c6a7a0d2c1d90c12559dc7828fd942911a544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/943894c6a6b00501365ac0b91ae0dce56f2226fa", - "reference": "943894c6a6b00501365ac0b91ae0dce56f2226fa", + "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/5f2c6a7a0d2c1d90c12559dc7828fd942911a544", + "reference": "5f2c6a7a0d2c1d90c12559dc7828fd942911a544", "shasum": "" }, "require": { @@ -8027,7 +8235,7 @@ ], "support": { "issues": "https://github.com/spatie/flare-client-php/issues", - "source": "https://github.com/spatie/flare-client-php/tree/1.4.1" + "source": "https://github.com/spatie/flare-client-php/tree/1.4.2" }, "funding": [ { @@ -8035,20 +8243,20 @@ "type": "github" } ], - "time": "2023-07-06T09:29:49+00:00" + "time": "2023-07-28T08:07:24+00:00" }, { "name": "spatie/ignition", - "version": "1.9.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/spatie/ignition.git", - "reference": "de24ff1e01814d5043bd6eb4ab36a5a852a04973" + "reference": "d92b9a081e99261179b63a858c7a4b01541e7dd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ignition/zipball/de24ff1e01814d5043bd6eb4ab36a5a852a04973", - "reference": "de24ff1e01814d5043bd6eb4ab36a5a852a04973", + "url": "https://api.github.com/repos/spatie/ignition/zipball/d92b9a081e99261179b63a858c7a4b01541e7dd1", + "reference": "d92b9a081e99261179b63a858c7a4b01541e7dd1", "shasum": "" }, "require": { @@ -8118,7 +8326,7 @@ "type": "github" } ], - "time": "2023-06-28T13:24:59+00:00" + "time": "2023-08-21T15:06:37+00:00" }, { "name": "spatie/laravel-ignition", @@ -8212,20 +8420,21 @@ }, { "name": "symfony/yaml", - "version": "v6.3.0", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "a9a8337aa641ef2aa39c3e028f9107ec391e5927" + "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/a9a8337aa641ef2aa39c3e028f9107ec391e5927", - "reference": "a9a8337aa641ef2aa39c3e028f9107ec391e5927", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e23292e8c07c85b971b44c1c4b87af52133e2add", + "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -8263,7 +8472,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.0" + "source": "https://github.com/symfony/yaml/tree/v6.3.3" }, "funding": [ { @@ -8279,7 +8488,7 @@ "type": "tidelift" } ], - "time": "2023-04-28T13:28:14+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "theseer/tokenizer", @@ -8341,5 +8550,5 @@ "php": "^8.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/src/routes/api.php b/src/routes/api.php index f676b21..7b295b1 100644 --- a/src/routes/api.php +++ b/src/routes/api.php @@ -39,7 +39,7 @@ /* Send a ping to our MongoDB cluster to see if our connection settings are correct */ -Route::get('/ping', function (Request $request) { +Route::get('/test_mongodb/', function (Request $request) { $connection = DB::connection('mongodb'); $msg = 'MongoDB is accessible!'; @@ -167,20 +167,6 @@ return ['status' => $message, 'data' => $success]; }); - -/* - ❌❌❌ insertOne() works well with an stdClass, but ❌ not with a Model (use Model::save() instead) -*/ -Route::get('/create_native/', function (Request $request) { - - /// ??? - - $resp = new stdClass; - $resp->msg = "executed"; - $resp->data = $result; - return $resp; -}); - /* Find records using a native MongoDB Query 1 - with Model->whereRaw() From 033ad7e7b135460d6b8f22307773414c92cf8353 Mon Sep 17 00:00:00 2001 From: Hubert Nguyen Date: Sun, 10 Sep 2023 18:41:10 -0700 Subject: [PATCH 18/18] Update .env.example --- src/.env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/.env.example b/src/.env.example index c565cf6..abe916a 100644 --- a/src/.env.example +++ b/src/.env.example @@ -1,6 +1,6 @@ -MONGODB_URI=mongodb://127.0.0.1:27017/ # replace with your live MongoDB Atlas cluster! +MONGODB_URI='mongodb://127.0.0.1:27017/' # replace with your live MongoDB Atlas cluster! -APP_NAME=Laravel +APP_NAME="Laravel MongoDB Tutorial" APP_ENV=local APP_KEY= APP_DEBUG=true