diff --git a/appengine/flexible/drupal8/README.md b/appengine/flexible/drupal8/README.md deleted file mode 100644 index f36a86861a..0000000000 --- a/appengine/flexible/drupal8/README.md +++ /dev/null @@ -1,95 +0,0 @@ -Drupal 8 on App Engine Flexible Environment -=========================================== - -## Overview - -This guide will help you deploy Drupal 8 on [App Engine Flexible][1] - -## Prerequisites - -Before setting up Drupal 8 on App Engine Flexible, you will need to complete the following: - - 1. Create a [Google Cloud Platform project][2]. Note your **Project ID**, as you will need it - later. - 1. Create a [Google Cloud SQL instance][3]. You will use this as your Drupal MySQL backend. - -## Install Drupal 8 - -### Download - -Use the [Drupal 8 Drush CLI][4] to install a drupal project. This can be installed locally -by running `composer install` in this directory: - -```sh -composer install -./vendor/bin/drush -``` - -Now you can run the command to download drupal: - -```sh -cd /path/to/drupal -/path/to/drush dl drupal -``` - -Alternatively, you can download a compressed file of Drupal 8 from the [Drupal Website][5]. - -### Installation - - 1. Set up your Drupal 8 instance using the web interface - ```sh - cd /path/to/drupal - php -S localhost:8080 - ``` - Open [http://localhost:8080](http://localhost:8080) in your browser after running these steps - - 1. You can also try setting up your Drupal 8 instance using [Drush][4] - ```sh - cd /path/to/drupal - /path/to/drush site-install \ - --locale=en \ - --db-path=mysql://user@pass:host/db_name \ - --site-name='My Drupal Site On Google' \ - --site-mail=you@example.com \ - --account-name admin \ - --account-mail you@example.com \ - --account-pass admin - ``` - -You will want to use the Cloud SQL credentials you created in the **Prerequisites** section as your -Drupal backend. - -## Add app.yaml - -Add a file `app.yaml` with the following contents to the root of your Drupal project: - -```yaml -runtime: php -env: flex -``` - -`app.yaml` is the App Engine configuration for your project. - -## Disable CSS and JS Cache - -For now, you need to disable the CSS and JS preprocessed caching that Drupal 8 enables by default. -To do this, go to `/admin/config/development/performance` and deselect the two -checkboxes (`Aggregate CSS files` and `Aggregate JS files`) under **Bandwidth Optimizations**. - -Alternatively, you can use [Drush][4] to change this config setting: - -```sh -# this command must be run inside the root directory of a drupal project -cd /path/to/drupal -/path/to/drush pm-enable config -y -/path/to/drush config-set system.performance css.preprocess 0 -/path/to/drush config-set system.performance js.preprocess 0 -``` - -This will change the values `preprocess` under `css` and `js` to `false`. - -[1]: https://cloud.google.com/appengine/docs/flexible/ -[2]: https://console.cloud.google.com -[3]: https://cloud.google.com/sql/docs/getting-started -[4]: http://docs.drush.org/en/master/install/ -[5]: https://www.drupal.org/8/download diff --git a/appengine/flexible/drupal8/app.yaml b/appengine/flexible/drupal8/app.yaml deleted file mode 100644 index 7ae9a2661c..0000000000 --- a/appengine/flexible/drupal8/app.yaml +++ /dev/null @@ -1,5 +0,0 @@ -runtime: php -env: flex - -runtime_config: - document_root: . diff --git a/appengine/flexible/drupal8/composer.json b/appengine/flexible/drupal8/composer.json deleted file mode 100644 index de9be9426d..0000000000 --- a/appengine/flexible/drupal8/composer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "require": { - "drush/drush": "^10.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^6.3", - "monolog/monolog": "^1.19", - "symfony/console": " ^2.7", - "symfony/process": "^3.0", - "paragonie/random_compat": " ^9.0" - } -} diff --git a/appengine/flexible/drupal8/phpunit.xml.dist b/appengine/flexible/drupal8/phpunit.xml.dist deleted file mode 100644 index da7ad8da8e..0000000000 --- a/appengine/flexible/drupal8/phpunit.xml.dist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - test - test/DeployTest.php - - - - - ./web - - ./vendor - - - - diff --git a/appengine/flexible/drupal8/test/DeployTest.php b/appengine/flexible/drupal8/test/DeployTest.php deleted file mode 100644 index 73d113ab98..0000000000 --- a/appengine/flexible/drupal8/test/DeployTest.php +++ /dev/null @@ -1,126 +0,0 @@ -setDir($tmpDir); - } - - private static function verifyEnvironmentVariables() - { - $envVars = [ - 'GOOGLE_PROJECT_ID', - 'DRUPAL8_ADMIN_USERNAME', - 'DRUPAL8_ADMIN_PASSWORD', - 'DRUPAL8_DATABASE_HOST', - 'DRUPAL8_DATABASE_NAME', - 'DRUPAL8_DATABASE_USER', - 'DRUPAL8_DATABASE_PASS', - ]; - foreach ($envVars as $envVar) { - if (false === getenv($envVar)) { - self::markTestSkipped("Please set the {$envVar} environment variable"); - } - } - } - - private static function downloadAndInstallDrupal($targetDir) - { - $console = __DIR__ . '/../vendor/bin/drush'; - - $dbUrl = sprintf( - 'mysql://%s:%s@%s/%s', - getenv('DRUPAL8_DATABASE_USER'), - getenv('DRUPAL8_DATABASE_PASS'), - getenv('DRUPAL8_DATABASE_HOST'), - getenv('DRUPAL8_DATABASE_NAME') - ); - - // download - self::setWorkingDirectory(dirname($targetDir)); - $downloadCmd = sprintf( - '%s dl drupal --drupal-project-rename=%s', - $console, - basename($targetDir) - ); - self::execute($downloadCmd); - - // install - self::setWorkingDirectory($targetDir); - $installCmd = sprintf( - '%s site-install standard ' . - '--db-url=%s --account-name=%s --account-pass=%s -y', - $console, - $dbUrl, - getenv('DRUPAL8_ADMIN_USERNAME'), - getenv('DRUPAL8_ADMIN_PASSWORD') - ); - $process = self::createProcess($installCmd); - $process->setTimeout(null); - self::executeProcess($process); - - // this is to fix a PHP runtime bug - // @TODO - FIX THIS!! - self::execute('rm composer.*'); - - // move the code for the sample to the new drupal installation - $files = ['app.yaml']; - foreach ($files as $file) { - $source = sprintf('%s/../%s', __DIR__, $file); - $target = sprintf('%s/%s', $targetDir, $file); - copy($source, $target); - } - } - - public function testContacts() - { - // Access the blog top page - $resp = $this->client->get('/contact'); - $this->assertEquals( - '200', - $resp->getStatusCode(), - 'top page status code' - ); - $content = $resp->getBody()->getContents(); - $this->assertStringContainsString('Website feedback', $content); - $this->assertStringContainsString('Drupal', $content); - } -} diff --git a/appengine/flexible/laravel/README.md b/appengine/flexible/laravel/README.md deleted file mode 100644 index 79e327688d..0000000000 --- a/appengine/flexible/laravel/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Laravel on App Engine Flexible Environment -========================================== - -**Code and tests for the Google Cloud Community article -[Run Laravel on Google App Engine Flexible Environment][5]** - -[5]: https://cloud.google.com/community/tutorials/run-laravel-on-appengine-flexible diff --git a/appengine/flexible/laravel/app-dbsessions.yaml b/appengine/flexible/laravel/app-dbsessions.yaml deleted file mode 100644 index 7c54770c24..0000000000 --- a/appengine/flexible/laravel/app-dbsessions.yaml +++ /dev/null @@ -1,29 +0,0 @@ -runtime: php -env: flex - -runtime_config: - document_root: public - -# Ensure we skip ".env", which is only for local development -skip_files: - - .env - -env_variables: - # Put production environment variables here. - APP_LOG: errorlog - APP_KEY: YOUR_APP_KEY - STORAGE_DIR: /tmp - CACHE_DRIVER: database - SESSION_DRIVER: database - ## Set these environment variables according to your CloudSQL configuration. - DB_HOST: localhost - DB_DATABASE: YOUR_DB_DATABASE - DB_USERNAME: YOUR_DB_USERNAME - DB_PASSWORD: YOUR_DB_PASSWORD - DB_SOCKET: "/cloudsql/YOUR_CLOUDSQL_CONNECTION_NAME" - -beta_settings: - # for Cloud SQL, uncomment and set this value to the Cloud SQL - # connection name, e.g. - # "project:region:cloudsql-instance" - cloud_sql_instances: "YOUR_CLOUDSQL_CONNECTION_NAME" diff --git a/appengine/flexible/laravel/app.yaml b/appengine/flexible/laravel/app.yaml deleted file mode 100644 index 8cb5301c90..0000000000 --- a/appengine/flexible/laravel/app.yaml +++ /dev/null @@ -1,15 +0,0 @@ -runtime: php -env: flex - -runtime_config: - document_root: public - enable_stackdriver_integration: true - -# Ensure we skip ".env", which is only for local development -skip_files: - - .env - -env_variables: - # Put production environment variables here. - LOG_CHANNEL: stackdriver - APP_KEY: YOUR_APP_KEY diff --git a/appengine/flexible/laravel/app/Exceptions/Handler.php b/appengine/flexible/laravel/app/Exceptions/Handler.php deleted file mode 100644 index 283cfd1f97..0000000000 --- a/appengine/flexible/laravel/app/Exceptions/Handler.php +++ /dev/null @@ -1,60 +0,0 @@ - env('LOG_CHANNEL', 'stack'), - - /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "custom", "stack" - | - */ - - 'channels' => [ - 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], - ], - - 'single' => [ - 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', - ], - - 'daily' => [ - 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', - 'days' => 7, - ], - - 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), - 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => 'critical', - ], - - 'syslog' => [ - 'driver' => 'syslog', - 'level' => 'debug', - ], - - 'errorlog' => [ - 'driver' => 'errorlog', - 'level' => 'debug', - ], - 'stackdriver' => [ - 'driver' => 'custom', - 'via' => App\Logging\CreateCustomLogger::class, - 'level' => 'debug', - ], - - ], - -]; diff --git a/appengine/flexible/laravel/phpunit.xml.dist b/appengine/flexible/laravel/phpunit.xml.dist deleted file mode 100644 index 74216aad61..0000000000 --- a/appengine/flexible/laravel/phpunit.xml.dist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - test - test/DeployTest.php - - - - - ./src - - ./vendor - - - - diff --git a/appengine/flexible/laravel/routes/web.php b/appengine/flexible/laravel/routes/web.php deleted file mode 100644 index 9e6d128db9..0000000000 --- a/appengine/flexible/laravel/routes/web.php +++ /dev/null @@ -1,25 +0,0 @@ -setDir($tmpDir); - chdir($tmpDir); - } - - private static function verifyEnvironmentVariables() - { - $envVars = [ - 'LARAVEL_CLOUDSQL_CONNECTION_NAME', - 'LARAVEL_DB_DATABASE', - 'LARAVEL_DB_USERNAME', - 'LARAVEL_DB_PASSWORD', - ]; - foreach ($envVars as $envVar) { - if (false === getenv($envVar)) { - self::fail("Please set the {$envVar} environment variable"); - } - } - } - - private static function createLaravelProject($targetDir) - { - // install - $laravelPackage = 'laravel/laravel'; - $cmd = sprintf('composer create-project --no-scripts %s %s', $laravelPackage, $targetDir); - $process = self::createProcess($cmd); - $process->setTimeout(300); // 5 minutes - self::executeProcess($process); - - // copy and set the proper env vars in app.yaml - $appYaml = str_replace([ - 'YOUR_APP_KEY', - 'YOUR_CLOUDSQL_CONNECTION_NAME', - 'YOUR_DB_DATABASE', - 'YOUR_DB_USERNAME', - 'YOUR_DB_PASSWORD', - ], [ - self::execute('php artisan key:generate --show --no-ansi'), - getenv('LARAVEL_CLOUDSQL_CONNECTION_NAME'), - getenv('LARAVEL_DB_DATABASE'), - getenv('LARAVEL_DB_USERNAME'), - getenv('LARAVEL_DB_PASSWORD'), - ], file_get_contents(__DIR__ . '/../app-dbsessions.yaml')); - file_put_contents($targetDir . '/app.yaml', $appYaml); - } - - private static function addPostDeployCommands($targetDir) - { - $contents = file_get_contents($targetDir . '/composer.json'); - $json = json_decode($contents, true); - $json['scripts']['post-install-cmd'] = [ - 'chmod -R 755 bootstrap\/cache', - 'php artisan cache:clear', - ]; - $newContents = json_encode($json, JSON_PRETTY_PRINT); - file_put_contents($targetDir . '/composer.json', $newContents); - } - - public function testHomepage() - { - // Access the blog top page - $resp = $this->client->get('/'); - $this->assertEquals( - '200', - $resp->getStatusCode(), - 'top page status code' - ); - $content = $resp->getBody()->getContents(); - $this->assertStringContainsString('Laravel', $content); - } -} diff --git a/appengine/flexible/laravel/test/DeployTest.php b/appengine/flexible/laravel/test/DeployTest.php deleted file mode 100644 index 2386bf380d..0000000000 --- a/appengine/flexible/laravel/test/DeployTest.php +++ /dev/null @@ -1,188 +0,0 @@ -setDir($tmpDir); - chdir($tmpDir); - } - - private static function createLaravelProject($targetDir) - { - // install - $laravelPackage = 'laravel/laravel'; - $cmd = sprintf('composer create-project --no-scripts %s %s', $laravelPackage, $targetDir); - $process = self::createProcess($cmd); - $process->setTimeout(300); // 5 minutes - self::executeProcess($process); - // add cloud libraries - $cmd = sprintf( - 'composer --working-dir=%s require google/cloud-logging ' - . 'google/cloud-error-reporting', - $targetDir - ); - $process = self::createProcess($cmd); - $process->setTimeout(300); // 5 minutes - self::executeProcess($process); - - // copy in the app.yaml and add the app key. - $appYaml = str_replace([ - 'YOUR_APP_KEY', - ], [ - self::execute('php artisan key:generate --show --no-ansi'), - ], file_get_contents(__DIR__ . '/../app.yaml')); - file_put_contents($targetDir . '/app.yaml', $appYaml); - // move the code for the sample to the new laravel installation - mkdir("$targetDir/app/Logging", 0700, true); - $files = [ - 'routes/web.php', - 'config/logging.php', - 'app/Exceptions/Handler.php', - 'app/Logging/CreateCustomLogger.php', - ]; - foreach ($files as $file) { - $source = sprintf('%s/../%s', __DIR__, $file); - $target = sprintf('%s/%s', $targetDir, $file); - copy($source, $target); - } - } - - private static function addPostDeployCommands($targetDir) - { - $contents = file_get_contents($targetDir . '/composer.json'); - $json = json_decode($contents, true); - $json['scripts']['post-install-cmd'] = [ - 'php artisan cache:clear', - ]; - $newContents = json_encode($json, JSON_PRETTY_PRINT); - file_put_contents($targetDir . '/composer.json', $newContents); - } - - public function testHomepage() - { - // Access the blog top page - $resp = $this->client->get('/'); - $this->assertEquals( - '200', - $resp->getStatusCode(), - 'top page status code' - ); - $content = $resp->getBody()->getContents(); - $this->assertStringContainsString('Laravel', $content); - } - - public function testNormalLog() - { - // Access a page erroring with 500 - $token = uniqid(); - // The routes are defined in routes/web.php - $path = "/log/$token"; - $resp = $this->client->request('GET', $path, ['http_errors' => false]); - $this->assertEquals( - '200', - $resp->getStatusCode(), - 'log page status code' - ); - $logging = new LoggingClient( - ['projectId' => getenv('GOOGLE_PROJECT_ID')] - ); - // 'app' is the default logname of our Stackdriver Logging - // integration. - $logger = $logging->logger('app'); - - $this->runEventuallyConsistentTest( - function () use ($logger, $token) { - $logs = $logger->entries([ - 'pageSize' => 100, - 'orderBy' => 'timestamp desc', - 'resultLimit' => 100 - ]); - $found = false; - foreach ($logs as $log) { - $info = $log->info(); - if (strpos("token: $token", $info['jsonPayload']['message']) !== 0) { - $found = true; - } - } - $this->assertTrue($found, 'The log entry was not found'); - }); - } - - public function testErrorLog() - { - // Access a page erroring with 500 - $token = uniqid(); - // The routes are defined in routes/web.php - $path = "/exception/$token"; - $resp = $this->client->request('GET', $path, ['http_errors' => false]); - $this->assertEquals( - '500', - $resp->getStatusCode(), - 'exception page status code' - ); - $logging = new LoggingClient( - ['projectId' => getenv('GOOGLE_PROJECT_ID')] - ); - // 'app-error' is the default logname of our Stackdriver Error - // Reporting integration. - $logger = $logging->logger('app-error'); - - $this->runEventuallyConsistentTest( - function () use ($logger, $token) { - $logs = $logger->entries([ - 'pageSize' => 100, - 'orderBy' => 'timestamp desc', - 'resultLimit' => 100 - ]); - $found = false; - foreach ($logs as $log) { - $info = $log->info(); - if (strpos("token: $token", $info['jsonPayload']['message']) !== 0) { - $found = true; - } - } - $this->assertTrue($found, 'The log entry was not found'); - }); - } -} diff --git a/renovate.json b/renovate.json index d99aa921b9..eb5971a17f 100644 --- a/renovate.json +++ b/renovate.json @@ -20,8 +20,7 @@ } ], "ignorePaths": [ - "appengine/flexible/", - "run/laravel/" + "appengine/flexible/" ], "branchPrefix": "renovate/", "additionalBranchPrefix": "{{parentDir}}-", diff --git a/run/README.md b/run/README.md index ed7e5fea4d..91b40177c2 100644 --- a/run/README.md +++ b/run/README.md @@ -9,7 +9,6 @@ | Sample | Description | Deploy | | --------------------------------------- | ------------------------ | ------------- | |[Hello World][helloworld] | Quickstart | [Run on Google Cloud][run_button_helloworld] | -|[Laravel][laravel] | Deploy Laravel on Cloud Run | -| |[Multi-container][multicontainer] | Multi-container samples (i.e nginx) | -| @@ -90,6 +89,5 @@ for more information. [run_build]: https://cloud.google.com/run/docs/building/containers [run_deploy]: https://cloud.google.com/run/docs/deploying [helloworld]: helloworld/ -[laravel]: laravel/ [multicontainer]: multi-container/ [run_button_helloworld]: https://deploy.cloud.run/?dir=run/helloworld diff --git a/run/laravel/.env.example b/run/laravel/.env.example deleted file mode 100644 index f6053d67aa..0000000000 --- a/run/laravel/.env.example +++ /dev/null @@ -1,22 +0,0 @@ -APP_NAME=MyApp -APP_ENV=local - -# this value will be generated -APP_KEY= - - -# Logging -LOG_CHANNEL=syslog -LOG_DEPRECATIONS_CHANNEL=null -LOG_LEVEL=debug - -# Database -DB_CONNECTION=mysql -DB_SOCKET=/cloudsql/PROJECT_ID:REGION:INSTANCE -DB_DATABASE= -DB_USERNAME= -DB_PASSWORD= - -# Static (generate ASSET_URL from the bucket name) -ASSET_BUCKET=BUCKET_NAME -ASSET_URL=https://storage.googleapis.com/${ASSET_BUCKET} diff --git a/run/laravel/.gcloudignore b/run/laravel/.gcloudignore deleted file mode 100644 index 3ad0e6396c..0000000000 --- a/run/laravel/.gcloudignore +++ /dev/null @@ -1,2 +0,0 @@ -#!include:.gitignore -.git \ No newline at end of file diff --git a/run/laravel/.gitignore b/run/laravel/.gitignore deleted file mode 100644 index 258becb5cc..0000000000 --- a/run/laravel/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -/node_modules -/public/build -/public/hot -/public/storage -/storage/*.key -/vendor -.env -.env.backup -.phpunit.result.cache -Homestead.json -Homestead.yaml -auth.json -npm-debug.log -yarn-error.log -/.idea -/.vscode -package.lock diff --git a/run/laravel/Procfile b/run/laravel/Procfile deleted file mode 100644 index 12ee0a43ab..0000000000 --- a/run/laravel/Procfile +++ /dev/null @@ -1,3 +0,0 @@ -web: pid1 --nginxBinaryPath nginx --nginxConfigPath /layers/google.php.webconfig/webconfig/nginx.conf --serverConfigPath /layers/google.php.webconfig/webconfig/nginxserver.conf --nginxErrLogFilePath /var/log/nginx.log --customAppCmd "php-fpm -R --nodaemonize --fpm-config /layers/google.php.webconfig/webconfig/php-fpm.conf" --pid1LogFilePath /var/log/pid1.log --mimeTypesPath /layers/google.utils.nginx/nginx/conf/mime.types --customAppSocket /layers/google.php.webconfig/webconfig/app.sock -migrate: php artisan migrate -static: npm run update-static \ No newline at end of file diff --git a/run/laravel/README.md b/run/laravel/README.md deleted file mode 100644 index 214fc80030..0000000000 --- a/run/laravel/README.md +++ /dev/null @@ -1,360 +0,0 @@ -# Laravel on Cloud Run - -This sample shows you how to deploy Laravel on Cloud Run, connecting to a Cloud SQL database, and using Secret Manager for credential management. - -The deployed example will be a simple CRUD application listing products, and a customised Laravel welcome page showing the deployment information. - -![Laravel Demo Screenshot](laravel-demo-screenshot.png) - - -## Objectives - -In this tutorial, you will: - -* Create and connect a Cloud SQL database. -* Create and use Secret Manager secret values. -* Deploy a Laravel app to Cloud Run. -* Host static files on Cloud Storage. -* Use Cloud Build to automate deployment. -* Use Cloud Run Jobs to apply database migrations. - -## Costs - -This tutorial uses the following billable components of Google Cloud: - -* Cloud SQL -* Cloud Storage -* Cloud Run -* Cloud Build -* Artifact Registry -* Secret Manager - - -## Prerequisites - -* Create a [Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects) -* Ensure [Billing](https://cloud.google.com/billing/docs/how-to/verify-billing-enabled) is enabled. -* [Install](https://cloud.google.com/sdk/docs/install) and [initialize](https://cloud.google.com/sdk/docs/initializing) the Google Cloud CLI - * You can run the gcloud CLI in the Google Cloud console without installing the Google Cloud CLI. To run the gcloud CLI in the Google Cloud console, use [Cloud Shell](https://console.cloud.google.com/home/dashboard?cloudshell=true). -* [Enable the required APIs](https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com,sql-component.googleapis.com,sqladmin.googleapis.com,compute.googleapis.com,cloudbuild.googleapis.com,secretmanager.googleapis.com,artifactregistry.googleapis.com) - ```bash - gcloud services enable \ - run.googleapis.com \ - sql-component.googleapis.com \ - sqladmin.googleapis.com \ - compute.googleapis.com \ - cloudbuild.googleapis.com \ - secretmanager.googleapis.com \ - artifactregistry.googleapis.com - ``` -* Ensure sufficient permissions are available to the account used for this tutorial - * Note: In cases where the [Owner](https://cloud.google.com/iam/docs/understanding-roles#basic) permissions role cannot be used, the following minimum roles are required to complete the tutorial: Cloud SQL Admin, Storage Admin, Cloud Run Admin, and Secret Manager Admin. - -## Prepare your environment - -* Clone a copy of the code into your local machine; - - ```bash - git clone https://github.com/GoogleCloudPlatform/php-docs-samples.git - cd php-docs-samples/run/laravel/ - ``` - -## Confirm your PHP setup - -You will need PHP on your local system in order to run `php artisan` commands later. - -* Check you have PHP 8.1 or higher installed (or [install it](https://www.php.net/manual/en/install.php)): - - ```bash - php --version - ``` - -* Check you have `composer` installed (or [install it](https://getcomposer.org/download/)): - - ```bash - composer --version - ``` - -* Install the PHP dependencies: - - ```bash - composer install - ``` - -## Confirm your Node setup - -You will need Node on your local system in order to generate static assets later. - -* Check you have node and npm installed (or [install them](https://cloud.google.com/nodejs/docs/setup)): - - ```bash - node --version - npm --version - ``` - - -* Install the Node dependencies: - - ```bash - npm install - ``` - - -## Preparing backing services - -There are many variables in this tutorial. Set these early to help with copying code snippets: - -``` -export PROJECT_ID=$(gcloud config get-value project) -export PROJECTNUM=$(gcloud projects describe ${PROJECT_ID} --format='value(projectNumber)') -export REGION=us-central1 -export INSTANCE_NAME=myinstance -export DATABASE_NAME=mydatabase -export DATABASE_USERNAME=myuser -export DATABASE_PASSWORD=$(cat /dev/urandom | LC_ALL=C tr -dc '[:alpha:]'| fold -w 30 | head -n1) -export ASSET_BUCKET=${PROJECT_ID}-static -``` - -### Cloud SQL - -* Create a MySQL instance: - - ```bash - gcloud sql instances create ${INSTANCE_NAME} \ - --project ${PROJECT_ID} \ - --database-version MYSQL_8_0 \ - --tier db-f1-micro \ - --region ${REGION} - ``` - - Note: if this operation takes longer than 10 minutes to complete, run the suggested `gcloud beta sql operations wait` command to track ongoing progress. - -* Create a database in that MySQL instance: - - ```bash - gcloud sql databases create ${DATABASE_NAME} \ - --instance ${INSTANCE_NAME} - ``` - -* Create a user for the database: - - ```bash - gcloud sql users create ${DATABASE_USERNAME} \ - --instance ${INSTANCE_NAME} \ - --password ${DATABASE_PASSWORD} - ``` - -### Setup Cloud Storage - - -* Create a Cloud Storage bucket: - - ```bash - gcloud storage buckets create gs://${ASSET_BUCKET} - ``` - -### Setup Artifact Registry - -* Create an Artifact Registry: - - ```bash - gcloud artifacts repositories create containers \ - --repository-format=docker \ - --location=${REGION} - ``` - -* Determine the registry name for future operations: - - ```bash - export REGISTRY_NAME=${REGION}-docker.pkg.dev/${PROJECT_ID}/containers - ``` - -### Configuring the Laravel Application - - -* Copy the `.env.example` file into `.env` - ```bash - cp .env.example .env - ``` - -* Update the values in `.env` with your values. - - ⚠️ Replace `${}` with your values, don't use the literals. Get these values with e.g. `echo ${DATABASE_NAME}` - - * DB_CONNECTION: `mysql` - * DB_SOCKET: `/cloudsql/${PROJECT_ID}:${REGION}:${INSTANCE_NAME}` - * DB_DATABASE: `${DATABASE_NAME}` - * DB_USERNAME: `${DATABASE_USERNAME}` - * DB_PASSWORD: `${DATABASE_PASSWORD}` - * ASSET_BUCKET: `${ASSET_BUCKET}` - - Note: `ASSET_URL` is generated from `ASSET_BUCKET` and doesn't need to be hardcoded. - -* Update the `APP_KEY` by generating a new key: - ```bash - php artisan key:generate - ``` -* Confirm the `APP_KEY` value in `.env` has been updated. - - -### Store secret values in Secret Manager - -* Create a secret with the value of your `.env` file: - - ```bash - gcloud secrets create laravel_settings --data-file .env - ``` - -### Configure access to the secret - -* Allow Cloud Run access to the secret: - - ```bash - gcloud secrets add-iam-policy-binding laravel_settings \ - --member serviceAccount:${PROJECTNUM}-compute@developer.gserviceaccount.com \ - --role roles/secretmanager.secretAccessor - ``` - -## Build, Migrate, and Deploy - -### Build the app into a container - -* Using Cloud Build and Google Cloud Buildpacks, create the container image: - - ```bash - gcloud builds submit \ - --pack image=${REGISTRY_NAME}/laravel - ``` - -### Applying database migrations - -With Cloud Run Jobs, you can use the same container from your service to perform administration tasks, such as database migrations. - -The configuration is similar to the deployment to Cloud Run, requiring the database and secret values. - -1. Create a Cloud Run job to apply database migrations: - - ``` - gcloud run jobs create migrate \ - --image=${REGISTRY_NAME}/laravel \ - --region=${REGION} \ - --set-cloudsql-instances ${PROJECT_ID}:${REGION}:${INSTANCE_NAME} \ - --set-secrets /config/.env=laravel_settings:latest \ - --command launcher \ - --args "php artisan migrate" - ``` - -1. Execute the job: - - ``` - gcloud run jobs execute migrate --region ${REGION} --wait - ``` - -* Confirm the application of database migrations by clicking the "See logs for this execution" link. - - * You should see "INFO Running migrations." with multiple items labelled "DONE". - * You should also see "Container called exit(0).", where `0` is the exit code for success. - -### Upload static assets - -Using the custom `npm` command, you can use `vite` to compile and `gcloud storage` to copy the assets from your application to Cloud Storage. - -* Upload static assets: - - ```bash - npm run update-static - ``` - - This command uses the `update-static` script in `package.json`. - -* Confirm the output of this operation - - * You should see vite returning "N modules transformed", and gcloud storage returning "Operation completed over N objects" - -### Deploy the service to Cloud Run - -1. Deploy the service from the previously created image, specifying the database connection and secret configuration: - - ```bash - gcloud run deploy laravel \ - --image ${REGISTRY_NAME}/laravel \ - --region $REGION \ - --set-cloudsql-instances ${PROJECT_ID}:${REGION}:${INSTANCE_NAME} \ - --set-secrets /config/.env=laravel_settings:latest \ - --allow-unauthenticated - ``` - -### Confirm deployment success - -1. Go to the Service URL to view the website. - -1. Confirm the information in the lower right of the Laravel welcome screen. - - * You should see a variation of "Laravel v9... (PHP v8...)" (the exact version of Laravel and PHP may change) - * You should see the a variation of "Service: laravel. Revision laravel-00001-vid." (the revision name ends in three random characters, which will differ for every deployment) - * You should see "Project: (your project). Region (your region)." - -1. Click on the "demo products" link, and create some entries. - - * You should be able to see a styled page, confirming static assets are being served. -You should be able to write entries to the database, and read them back again, confirming database connectivity. - -## Updating the application - -While the initial provisioning and deployment steps were complex, making updates is a simpler process. - -To make changes: build the container (to capture any new application changes), then update the service to use this new container image: - - ```bash - gcloud builds submit \ - --pack image=${REGISTRY_NAME}/laravel - ``` - -To apply application code changes, update the Cloud Run service with this new container: - - ```bash - gcloud run services update laravel \ - --image ${REGISTRY_NAME}/laravel \ - --region ${REGION} - ``` - - Note: you do not have to re-assert the database or secret settings on future deployments, unless you want to change these values. - -To apply database migrations, run the Cloud Run job using the newly built container: - - ```bash - gcloud run jobs execute migrate --region ${REGION} - ``` - - Note: To generate new migrations to apply, you will need to run `php artisan make:migration` in a local development environment. - -To update static assets, run the custom npm command from earlier: - - ```bash - npm run update-static - ``` - - -## Understanding the Code - -### Database migrations - -This tutorial opts to use Cloud Run Jobs to process database applications in an environment where connections to Cloud SQL can be done in a safe and secure manner. - -This operation could be done on the user's local machine, which would require the installation and use of [Cloud SQL Auth Proxy](https://cloud.google.com/sql/docs/mysql/sql-proxy). Using Cloud Run Jobs removes that complexity. - -### Static compilation - -This tutorial opts to use the user's local machine for compiling and uploading static assets. While this could be done in Cloud Run Jobs, this would require building a container with both PHP and NodeJS runtimes. Because NodeJS isn't required for running the service, this isn't required to be in the container. - -### Secrets access - -`bootstrap/app.php` includes code to load the mounted secrets, if the folder has been mounted. This relates to the `--set-secrets` command used earlier. (Look for the `cloudrun_laravel_secret_manager_mount` tag.) - -### Environment information - -`routes/web.php` includes code to retrieve the service and revision information from Cloud Run environment variable, and from the\ Cloud Run metadata service (Look for the `cloudrun_laravel_get_metadata` tag.) - -## Learn more - -* [Getting started with PHP on Google Cloud](https://cloud.google.com/php/getting-started) diff --git a/run/laravel/app/Console/Kernel.php b/run/laravel/app/Console/Kernel.php deleted file mode 100644 index e1d9417be4..0000000000 --- a/run/laravel/app/Console/Kernel.php +++ /dev/null @@ -1,32 +0,0 @@ -command('inspire')->hourly(); - } - - /** - * Register the commands for the application. - * - * @return void - */ - protected function commands() - { - $this->load(__DIR__ . '/Commands'); - - require base_path('routes/console.php'); - } -} diff --git a/run/laravel/app/Exceptions/Handler.php b/run/laravel/app/Exceptions/Handler.php deleted file mode 100644 index 82a37e4008..0000000000 --- a/run/laravel/app/Exceptions/Handler.php +++ /dev/null @@ -1,50 +0,0 @@ -, \Psr\Log\LogLevel::*> - */ - protected $levels = [ - // - ]; - - /** - * A list of the exception types that are not reported. - * - * @var array> - */ - protected $dontReport = [ - // - ]; - - /** - * A list of the inputs that are never flashed to the session on validation exceptions. - * - * @var array - */ - protected $dontFlash = [ - 'current_password', - 'password', - 'password_confirmation', - ]; - - /** - * Register the exception handling callbacks for the application. - * - * @return void - */ - public function register() - { - $this->reportable(function (Throwable $e) { - // - }); - } -} diff --git a/run/laravel/app/Http/Controllers/Controller.php b/run/laravel/app/Http/Controllers/Controller.php deleted file mode 100644 index ce1176ddb2..0000000000 --- a/run/laravel/app/Http/Controllers/Controller.php +++ /dev/null @@ -1,15 +0,0 @@ -paginate(5); - - return view('products.index', compact('products')) - ->with('i', (request()->input('page', 1) - 1) * 5); - } - - /** - * Show the form for creating a new resource. - * - * @return \Illuminate\Http\Response - */ - public function create() - { - return view('products.create'); - } - - /** - * Store a newly created resource in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function store(Request $request) - { - $request->validate([ - 'name' => 'required', - 'description' => 'required', - ]); - - $product = Product::create($request->all()); - - return redirect()->route('products.index') - ->with('success', 'Product "' . $product->name . '" created successfully.'); - } - - /** - * Display the specified resource. - * - * @param \App\Models\Product $product - * @return \Illuminate\Http\Response - */ - public function show(Product $product) - { - return view('products.show', compact('product')); - } - - /** - * Show the form for editing the specified resource. - * - * @param \App\Models\Product $product - * @return \Illuminate\Http\Response - */ - public function edit(Product $product) - { - return view('products.edit', compact('product')); - } - - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param \App\Models\Product $product - * @return \Illuminate\Http\Response - */ - public function update(Request $request, Product $product) - { - $request->validate([ - 'name' => 'required', - 'description' => 'required', - ]); - - $product->update($request->all()); - - return redirect()->route('products.index') - ->with('success', 'Product "' . $product->name . '" updated.'); - } - /** - * Remove the specified resource from storage. - * - * @param \App\Models\Product $product - * @return \Illuminate\Http\Response - */ - public function destroy(Product $product) - { - $product->delete(); - - return redirect()->route('products.index') - ->with('success', 'Product "' . $product->name . '" deleted.'); - } -} diff --git a/run/laravel/app/Http/Kernel.php b/run/laravel/app/Http/Kernel.php deleted file mode 100644 index c3be2544bd..0000000000 --- a/run/laravel/app/Http/Kernel.php +++ /dev/null @@ -1,67 +0,0 @@ - - */ - protected $middleware = [ - // \App\Http\Middleware\TrustHosts::class, - \App\Http\Middleware\TrustProxies::class, - \Illuminate\Http\Middleware\HandleCors::class, - \App\Http\Middleware\PreventRequestsDuringMaintenance::class, - \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, - \App\Http\Middleware\TrimStrings::class, - \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, - ]; - - /** - * The application's route middleware groups. - * - * @var array> - */ - protected $middlewareGroups = [ - 'web' => [ - \App\Http\Middleware\EncryptCookies::class, - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\VerifyCsrfToken::class, - \Illuminate\Routing\Middleware\SubstituteBindings::class, - ], - - 'api' => [ - // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, - 'throttle:api', - \Illuminate\Routing\Middleware\SubstituteBindings::class, - ], - ]; - - /** - * The application's route middleware. - * - * These middleware may be assigned to groups or used individually. - * - * @var array - */ - protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, - 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, - 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, - 'can' => \Illuminate\Auth\Middleware\Authorize::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, - 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, - 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, - 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, - ]; -} diff --git a/run/laravel/app/Http/Middleware/Authenticate.php b/run/laravel/app/Http/Middleware/Authenticate.php deleted file mode 100644 index 704089a7fe..0000000000 --- a/run/laravel/app/Http/Middleware/Authenticate.php +++ /dev/null @@ -1,21 +0,0 @@ -expectsJson()) { - return route('login'); - } - } -} diff --git a/run/laravel/app/Http/Middleware/EncryptCookies.php b/run/laravel/app/Http/Middleware/EncryptCookies.php deleted file mode 100644 index 867695bdcf..0000000000 --- a/run/laravel/app/Http/Middleware/EncryptCookies.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - protected $except = [ - // - ]; -} diff --git a/run/laravel/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/run/laravel/app/Http/Middleware/PreventRequestsDuringMaintenance.php deleted file mode 100644 index 74cbd9a9ea..0000000000 --- a/run/laravel/app/Http/Middleware/PreventRequestsDuringMaintenance.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - protected $except = [ - // - ]; -} diff --git a/run/laravel/app/Http/Middleware/RedirectIfAuthenticated.php b/run/laravel/app/Http/Middleware/RedirectIfAuthenticated.php deleted file mode 100644 index a2813a0648..0000000000 --- a/run/laravel/app/Http/Middleware/RedirectIfAuthenticated.php +++ /dev/null @@ -1,32 +0,0 @@ -check()) { - return redirect(RouteServiceProvider::HOME); - } - } - - return $next($request); - } -} diff --git a/run/laravel/app/Http/Middleware/TrimStrings.php b/run/laravel/app/Http/Middleware/TrimStrings.php deleted file mode 100644 index 88cadcaaf2..0000000000 --- a/run/laravel/app/Http/Middleware/TrimStrings.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ - protected $except = [ - 'current_password', - 'password', - 'password_confirmation', - ]; -} diff --git a/run/laravel/app/Http/Middleware/TrustHosts.php b/run/laravel/app/Http/Middleware/TrustHosts.php deleted file mode 100644 index 7186414c65..0000000000 --- a/run/laravel/app/Http/Middleware/TrustHosts.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - public function hosts() - { - return [ - $this->allSubdomainsOfApplicationUrl(), - ]; - } -} diff --git a/run/laravel/app/Http/Middleware/TrustProxies.php b/run/laravel/app/Http/Middleware/TrustProxies.php deleted file mode 100644 index 3391630ecc..0000000000 --- a/run/laravel/app/Http/Middleware/TrustProxies.php +++ /dev/null @@ -1,28 +0,0 @@ -|string|null - */ - protected $proxies; - - /** - * The headers that should be used to detect proxies. - * - * @var int - */ - protected $headers = - Request::HEADER_X_FORWARDED_FOR | - Request::HEADER_X_FORWARDED_HOST | - Request::HEADER_X_FORWARDED_PORT | - Request::HEADER_X_FORWARDED_PROTO | - Request::HEADER_X_FORWARDED_AWS_ELB; -} diff --git a/run/laravel/app/Http/Middleware/VerifyCsrfToken.php b/run/laravel/app/Http/Middleware/VerifyCsrfToken.php deleted file mode 100644 index 9e86521722..0000000000 --- a/run/laravel/app/Http/Middleware/VerifyCsrfToken.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - protected $except = [ - // - ]; -} diff --git a/run/laravel/app/Models/Product.php b/run/laravel/app/Models/Product.php deleted file mode 100644 index 1bd2675fae..0000000000 --- a/run/laravel/app/Models/Product.php +++ /dev/null @@ -1,15 +0,0 @@ - - */ - protected $fillable = [ - 'name', - 'email', - 'password', - ]; - - /** - * The attributes that should be hidden for serialization. - * - * @var array - */ - protected $hidden = [ - 'password', - 'remember_token', - ]; - - /** - * The attributes that should be cast. - * - * @var array - */ - protected $casts = [ - 'email_verified_at' => 'datetime', - ]; -} diff --git a/run/laravel/app/Providers/AppServiceProvider.php b/run/laravel/app/Providers/AppServiceProvider.php deleted file mode 100644 index b5a6523ede..0000000000 --- a/run/laravel/app/Providers/AppServiceProvider.php +++ /dev/null @@ -1,30 +0,0 @@ - - */ - protected $policies = [ - // 'App\Models\Model' => 'App\Policies\ModelPolicy', - ]; - - /** - * Register any authentication / authorization services. - * - * @return void - */ - public function boot() - { - $this->registerPolicies(); - - // - } -} diff --git a/run/laravel/app/Providers/BroadcastServiceProvider.php b/run/laravel/app/Providers/BroadcastServiceProvider.php deleted file mode 100644 index 395c518bc4..0000000000 --- a/run/laravel/app/Providers/BroadcastServiceProvider.php +++ /dev/null @@ -1,21 +0,0 @@ -> - */ - protected $listen = [ - Registered::class => [ - SendEmailVerificationNotification::class, - ], - ]; - - /** - * Register any events for your application. - * - * @return void - */ - public function boot() - { - // - } - - /** - * Determine if events and listeners should be automatically discovered. - * - * @return bool - */ - public function shouldDiscoverEvents() - { - return false; - } -} diff --git a/run/laravel/app/Providers/RouteServiceProvider.php b/run/laravel/app/Providers/RouteServiceProvider.php deleted file mode 100644 index 7ebb560cbb..0000000000 --- a/run/laravel/app/Providers/RouteServiceProvider.php +++ /dev/null @@ -1,52 +0,0 @@ -configureRateLimiting(); - - $this->routes(function () { - Route::middleware('api') - ->prefix('api') - ->group(base_path('routes/api.php')); - - Route::middleware('web') - ->group(base_path('routes/web.php')); - }); - } - - /** - * Configure the rate limiters for the application. - * - * @return void - */ - protected function configureRateLimiting() - { - RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60)->by($request->user()->id ?? $request->ip()); - }); - } -} diff --git a/run/laravel/artisan b/run/laravel/artisan deleted file mode 100755 index 67a3329b18..0000000000 --- a/run/laravel/artisan +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env php -make(Illuminate\Contracts\Console\Kernel::class); - -$status = $kernel->handle( - $input = new Symfony\Component\Console\Input\ArgvInput, - new Symfony\Component\Console\Output\ConsoleOutput -); - -/* -|-------------------------------------------------------------------------- -| Shutdown The Application -|-------------------------------------------------------------------------- -| -| Once Artisan has finished running, we will fire off the shutdown events -| so that any final work may be done by the application before we shut -| down the process. This is the last thing to happen to the request. -| -*/ - -$kernel->terminate($input, $status); - -exit($status); diff --git a/run/laravel/bootstrap/app.php b/run/laravel/bootstrap/app.php deleted file mode 100644 index 7b2203c017..0000000000 --- a/run/laravel/bootstrap/app.php +++ /dev/null @@ -1,64 +0,0 @@ -singleton( - Illuminate\Contracts\Http\Kernel::class, - App\Http\Kernel::class -); - -$app->singleton( - Illuminate\Contracts\Console\Kernel::class, - App\Console\Kernel::class -); - -$app->singleton( - Illuminate\Contracts\Debug\ExceptionHandler::class, - App\Exceptions\Handler::class -); - -// [START cloudrun_laravel_secret_manager_mount] -/* Load settings from a mounted volume, if available. */ -$settings_dir = $_ENV['APP_SETTINGS_DIR'] ?? '/config'; - -if (file_exists($settings_dir . '/.env')) { - $dotenv = Dotenv\Dotenv::createImmutable($settings_dir); - $dotenv->load(); -} -// [END cloudrun_laravel_secret_manager_mount] - -/* -|-------------------------------------------------------------------------- -| Return The Application -|-------------------------------------------------------------------------- -| -| This script returns the application instance. The instance is given to -| the calling script so we can separate the building of the instances -| from the actual running of the application and sending responses. -| -*/ - -return $app; diff --git a/run/laravel/bootstrap/cache/.gitignore b/run/laravel/bootstrap/cache/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/run/laravel/bootstrap/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/run/laravel/composer.json b/run/laravel/composer.json deleted file mode 100644 index 9ec37e4b6b..0000000000 --- a/run/laravel/composer.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "laravel/laravel", - "type": "project", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "require": { - "php": "^8.1", - "google/auth": "^1.24", - "google/cloud-core": "^1.46", - "guzzlehttp/guzzle": "^7.2", - "laravel/framework": "^9.19", - "laravel/sanctum": "^2.14.1", - "laravel/tinker": "^2.7", - "vlucas/phpdotenv": "^5.4" - }, - "require-dev": { - "fakerphp/faker": "^1.9.1", - "laravel/sail": "^1.0.1", - "mockery/mockery": "^1.4.4", - "nunomaduro/collision": "^6.1", - "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ignition": "^1.0" - }, - "autoload": { - "psr-4": { - "App\\": "app/", - "Database\\Factories\\": "database/factories/", - "Database\\Seeders\\": "database/seeders/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests/" - } - }, - "scripts": { - "post-autoload-dump": [ - "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", - "@php artisan package:discover --ansi" - ], - "post-update-cmd": [ - "@php artisan vendor:publish --tag=laravel-assets --ansi --force" - ], - "post-root-package-install": [ - "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" - ], - "post-create-project-cmd": [ - "@php artisan key:generate --ansi" - ] - }, - "extra": { - "laravel": { - "dont-discover": [] - } - }, - "config": { - "optimize-autoloader": true, - "preferred-install": "dist", - "sort-packages": true - }, - "minimum-stability": "dev", - "prefer-stable": true -} \ No newline at end of file diff --git a/run/laravel/config/app.php b/run/laravel/config/app.php deleted file mode 100644 index ef76a7ed6a..0000000000 --- a/run/laravel/config/app.php +++ /dev/null @@ -1,215 +0,0 @@ - env('APP_NAME', 'Laravel'), - - /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services the application utilizes. Set this in your ".env" file. - | - */ - - 'env' => env('APP_ENV', 'production'), - - /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | - */ - - 'debug' => (bool) env('APP_DEBUG', false), - - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ - - 'url' => env('APP_URL', 'http://localhost'), - - 'asset_url' => env('ASSET_URL'), - - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ - - 'timezone' => 'UTC', - - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ - - 'locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ - - 'fallback_locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Faker Locale - |-------------------------------------------------------------------------- - | - | This locale will be used by the Faker PHP library when generating fake - | data for your database seeds. For example, this will be used to get - | localized telephone numbers, street address information and more. - | - */ - - 'faker_locale' => 'en_US', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => env('APP_KEY'), - - 'cipher' => 'AES-256-CBC', - - /* - |-------------------------------------------------------------------------- - | Maintenance Mode Driver - |-------------------------------------------------------------------------- - | - | These configuration options determine the driver used to determine and - | manage Laravel's "maintenance mode" status. The "cache" driver will - | allow maintenance mode to be controlled across multiple machines. - | - | Supported drivers: "file", "cache" - | - */ - - 'maintenance' => [ - 'driver' => 'file', - // 'store' => 'redis', - ], - - /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ - - 'providers' => [ - - /* - * Laravel Framework Service Providers... - */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - Illuminate\Translation\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, - - /* - * Package Service Providers... - */ - - /* - * Application Service Providers... - */ - App\Providers\AppServiceProvider::class, - App\Providers\AuthServiceProvider::class, - // App\Providers\BroadcastServiceProvider::class, - App\Providers\EventServiceProvider::class, - App\Providers\RouteServiceProvider::class, - - ], - - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ - - 'aliases' => Facade::defaultAliases()->merge([ - // 'ExampleClass' => App\Example\ExampleClass::class, - ])->toArray(), - -]; diff --git a/run/laravel/config/auth.php b/run/laravel/config/auth.php deleted file mode 100644 index d8c6cee7c1..0000000000 --- a/run/laravel/config/auth.php +++ /dev/null @@ -1,111 +0,0 @@ - [ - 'guard' => 'web', - 'passwords' => 'users', - ], - - /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session" - | - */ - - 'guards' => [ - 'web' => [ - 'driver' => 'session', - 'provider' => 'users', - ], - ], - - /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | - */ - - 'providers' => [ - 'users' => [ - 'driver' => 'eloquent', - 'model' => App\Models\User::class, - ], - - // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', - // ], - ], - - /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that each reset token will be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ - - 'passwords' => [ - 'users' => [ - 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, - 'throttle' => 60, - ], - ], - - /* - |-------------------------------------------------------------------------- - | Password Confirmation Timeout - |-------------------------------------------------------------------------- - | - | Here you may define the amount of seconds before a password confirmation - | times out and the user is prompted to re-enter their password via the - | confirmation screen. By default, the timeout lasts for three hours. - | - */ - - 'password_timeout' => 10800, - -]; diff --git a/run/laravel/config/broadcasting.php b/run/laravel/config/broadcasting.php deleted file mode 100644 index 3fe737e3e9..0000000000 --- a/run/laravel/config/broadcasting.php +++ /dev/null @@ -1,70 +0,0 @@ - env('BROADCAST_DRIVER', 'null'), - - /* - |-------------------------------------------------------------------------- - | Broadcast Connections - |-------------------------------------------------------------------------- - | - | Here you may define all of the broadcast connections that will be used - | to broadcast events to other systems or over websockets. Samples of - | each available type of connection are provided inside this array. - | - */ - - 'connections' => [ - - 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), - 'options' => [ - 'host' => env('PUSHER_HOST', 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com') ?: 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com', - 'port' => env('PUSHER_PORT', 443), - 'scheme' => env('PUSHER_SCHEME', 'https'), - 'encrypted' => true, - 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', - ], - 'client_options' => [ - // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html - ], - ], - - 'ably' => [ - 'driver' => 'ably', - 'key' => env('ABLY_KEY'), - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - ], - - 'log' => [ - 'driver' => 'log', - ], - - 'null' => [ - 'driver' => 'null', - ], - - ], - -]; diff --git a/run/laravel/config/cache.php b/run/laravel/config/cache.php deleted file mode 100644 index daf5e68be5..0000000000 --- a/run/laravel/config/cache.php +++ /dev/null @@ -1,110 +0,0 @@ - env('CACHE_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | - | Supported drivers: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb", "octane", "null" - | - */ - - 'stores' => [ - - 'apc' => [ - 'driver' => 'apc', - ], - - 'array' => [ - 'driver' => 'array', - 'serialize' => false, - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'cache', - 'connection' => null, - 'lock_connection' => null, - ], - - 'file' => [ - 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), - ], - - 'memcached' => [ - 'driver' => 'memcached', - 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ - env('MEMCACHED_USERNAME'), - env('MEMCACHED_PASSWORD'), - ], - 'options' => [ - // Memcached::OPT_CONNECT_TIMEOUT => 2000, - ], - 'servers' => [ - [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), - 'weight' => 100, - ], - ], - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'cache', - 'lock_connection' => 'default', - ], - - 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), - 'endpoint' => env('DYNAMODB_ENDPOINT'), - ], - - 'octane' => [ - 'driver' => 'octane', - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing the APC, database, memcached, Redis, or DynamoDB cache - | stores there might be other applications using the same cache. For - | that reason, you may prefix every cache key to avoid collisions. - | - */ - - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), - -]; diff --git a/run/laravel/config/cors.php b/run/laravel/config/cors.php deleted file mode 100644 index 8a39e6daa6..0000000000 --- a/run/laravel/config/cors.php +++ /dev/null @@ -1,34 +0,0 @@ - ['api/*', 'sanctum/csrf-cookie'], - - 'allowed_methods' => ['*'], - - 'allowed_origins' => ['*'], - - 'allowed_origins_patterns' => [], - - 'allowed_headers' => ['*'], - - 'exposed_headers' => [], - - 'max_age' => 0, - - 'supports_credentials' => false, - -]; diff --git a/run/laravel/config/database.php b/run/laravel/config/database.php deleted file mode 100644 index 535cd52572..0000000000 --- a/run/laravel/config/database.php +++ /dev/null @@ -1,151 +0,0 @@ - env('DB_CONNECTION', 'mysql'), - - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ - - 'connections' => [ - - 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', - 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), - ], - - 'mysql' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), - ]) : [], - ], - - 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - 'search_path' => 'public', - 'sslmode' => 'prefer', - ], - - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - // 'encrypt' => env('DB_ENCRYPT', 'yes'), - // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ - - 'migrations' => 'migrations', - - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer body of commands than a typical key-value system - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ - - 'redis' => [ - - 'client' => env('REDIS_CLIENT', 'phpredis'), - - 'options' => [ - 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), - ], - - 'default' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'username' => env('REDIS_USERNAME'), - 'password' => env('REDIS_PASSWORD'), - 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_DB', '0'), - ], - - 'cache' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'username' => env('REDIS_USERNAME'), - 'password' => env('REDIS_PASSWORD'), - 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_CACHE_DB', '1'), - ], - - ], - -]; diff --git a/run/laravel/config/filesystems.php b/run/laravel/config/filesystems.php deleted file mode 100644 index 4afc1fc63a..0000000000 --- a/run/laravel/config/filesystems.php +++ /dev/null @@ -1,76 +0,0 @@ - env('FILESYSTEM_DISK', 'local'), - - /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | Here you may configure as many filesystem "disks" as you wish, and you - | may even configure multiple disks of the same driver. Defaults have - | been set up for each driver as an example of the required values. - | - | Supported Drivers: "local", "ftp", "sftp", "s3" - | - */ - - 'disks' => [ - - 'local' => [ - 'driver' => 'local', - 'root' => storage_path('app'), - 'throw' => false, - ], - - 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL') . '/storage', - 'visibility' => 'public', - 'throw' => false, - ], - - 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), - 'url' => env('AWS_URL'), - 'endpoint' => env('AWS_ENDPOINT'), - 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), - 'throw' => false, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Symbolic Links - |-------------------------------------------------------------------------- - | - | Here you may configure the symbolic links that will be created when the - | `storage:link` Artisan command is executed. The array keys should be - | the locations of the links and the values should be their targets. - | - */ - - 'links' => [ - public_path('storage') => storage_path('app/public'), - ], - -]; diff --git a/run/laravel/config/hashing.php b/run/laravel/config/hashing.php deleted file mode 100644 index bcd3be4c28..0000000000 --- a/run/laravel/config/hashing.php +++ /dev/null @@ -1,52 +0,0 @@ - 'bcrypt', - - /* - |-------------------------------------------------------------------------- - | Bcrypt Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Bcrypt algorithm. This will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), - ], - - /* - |-------------------------------------------------------------------------- - | Argon Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Argon algorithm. These will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'argon' => [ - 'memory' => 65536, - 'threads' => 1, - 'time' => 4, - ], - -]; diff --git a/run/laravel/config/logging.php b/run/laravel/config/logging.php deleted file mode 100644 index 752af7110d..0000000000 --- a/run/laravel/config/logging.php +++ /dev/null @@ -1,122 +0,0 @@ - env('LOG_CHANNEL', 'stack'), - - /* - |-------------------------------------------------------------------------- - | Deprecations Log Channel - |-------------------------------------------------------------------------- - | - | This option controls the log channel that should be used to log warnings - | regarding deprecated PHP and library features. This allows you to get - | your application ready for upcoming major versions of dependencies. - | - */ - - 'deprecations' => [ - 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), - 'trace' => false, - ], - - /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "monolog", - | "custom", "stack" - | - */ - - 'channels' => [ - 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], - 'ignore_exceptions' => false, - ], - - 'single' => [ - 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'daily' => [ - 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - 'days' => 14, - ], - - 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), - 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => env('LOG_LEVEL', 'critical'), - ], - - 'papertrail' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), - 'handler_with' => [ - 'host' => env('PAPERTRAIL_URL'), - 'port' => env('PAPERTRAIL_PORT'), - 'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'), - ], - ], - - 'stderr' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => StreamHandler::class, - 'formatter' => env('LOG_STDERR_FORMATTER'), - 'with' => [ - 'stream' => 'php://stderr', - ], - ], - - 'syslog' => [ - 'driver' => 'syslog', - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'errorlog' => [ - 'driver' => 'errorlog', - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'null' => [ - 'driver' => 'monolog', - 'handler' => NullHandler::class, - ], - - 'emergency' => [ - 'path' => storage_path('logs/laravel.log'), - ], - ], - -]; diff --git a/run/laravel/config/mail.php b/run/laravel/config/mail.php deleted file mode 100644 index 534395a369..0000000000 --- a/run/laravel/config/mail.php +++ /dev/null @@ -1,118 +0,0 @@ - env('MAIL_MAILER', 'smtp'), - - /* - |-------------------------------------------------------------------------- - | Mailer Configurations - |-------------------------------------------------------------------------- - | - | Here you may configure all of the mailers used by your application plus - | their respective settings. Several examples have been configured for - | you and you are free to add your own as your application requires. - | - | Laravel supports a variety of mail "transport" drivers to be used while - | sending an e-mail. You will specify which one you are using for your - | mailers below. You are free to add additional mailers as required. - | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array", "failover" - | - */ - - 'mailers' => [ - 'smtp' => [ - 'transport' => 'smtp', - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - 'port' => env('MAIL_PORT', 587), - 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - 'username' => env('MAIL_USERNAME'), - 'password' => env('MAIL_PASSWORD'), - 'timeout' => null, - 'local_domain' => env('MAIL_EHLO_DOMAIN'), - ], - - 'ses' => [ - 'transport' => 'ses', - ], - - 'mailgun' => [ - 'transport' => 'mailgun', - ], - - 'postmark' => [ - 'transport' => 'postmark', - ], - - 'sendmail' => [ - 'transport' => 'sendmail', - 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), - ], - - 'log' => [ - 'transport' => 'log', - 'channel' => env('MAIL_LOG_CHANNEL'), - ], - - 'array' => [ - 'transport' => 'array', - ], - - 'failover' => [ - 'transport' => 'failover', - 'mailers' => [ - 'smtp', - 'log', - ], - ], - ], - - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ - - 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), - ], - - /* - |-------------------------------------------------------------------------- - | Markdown Mail Settings - |-------------------------------------------------------------------------- - | - | If you are using Markdown based email rendering, you may configure your - | theme and component paths here, allowing you to customize the design - | of the emails. Or, you may simply stick with the Laravel defaults! - | - */ - - 'markdown' => [ - 'theme' => 'default', - - 'paths' => [ - resource_path('views/vendor/mail'), - ], - ], - -]; diff --git a/run/laravel/config/queue.php b/run/laravel/config/queue.php deleted file mode 100644 index 25ea5a8193..0000000000 --- a/run/laravel/config/queue.php +++ /dev/null @@ -1,93 +0,0 @@ - env('QUEUE_CONNECTION', 'sync'), - - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" - | - */ - - 'connections' => [ - - 'sync' => [ - 'driver' => 'sync', - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'retry_after' => 90, - 'after_commit' => false, - ], - - 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 90, - 'block_for' => 0, - 'after_commit' => false, - ], - - 'sqs' => [ - 'driver' => 'sqs', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'default'), - 'suffix' => env('SQS_SUFFIX'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'after_commit' => false, - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => env('REDIS_QUEUE', 'default'), - 'retry_after' => 90, - 'block_for' => null, - 'after_commit' => false, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ - - 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), - 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', - ], - -]; diff --git a/run/laravel/config/sanctum.php b/run/laravel/config/sanctum.php deleted file mode 100644 index 529cfdc991..0000000000 --- a/run/laravel/config/sanctum.php +++ /dev/null @@ -1,67 +0,0 @@ - explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( - '%s%s', - 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', - Sanctum::currentApplicationUrlWithPort() - ))), - - /* - |-------------------------------------------------------------------------- - | Sanctum Guards - |-------------------------------------------------------------------------- - | - | This array contains the authentication guards that will be checked when - | Sanctum is trying to authenticate a request. If none of these guards - | are able to authenticate the request, Sanctum will use the bearer - | token that's present on an incoming request for authentication. - | - */ - - 'guard' => ['web'], - - /* - |-------------------------------------------------------------------------- - | Expiration Minutes - |-------------------------------------------------------------------------- - | - | This value controls the number of minutes until an issued token will be - | considered expired. If this value is null, personal access tokens do - | not expire. This won't tweak the lifetime of first-party sessions. - | - */ - - 'expiration' => null, - - /* - |-------------------------------------------------------------------------- - | Sanctum Middleware - |-------------------------------------------------------------------------- - | - | When authenticating your first-party SPA with Sanctum you may need to - | customize some of the middleware Sanctum uses while processing the - | request. You may change the middleware listed below as required. - | - */ - - 'middleware' => [ - 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, - 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, - ], - -]; diff --git a/run/laravel/config/services.php b/run/laravel/config/services.php deleted file mode 100644 index 0ace530e8d..0000000000 --- a/run/laravel/config/services.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'domain' => env('MAILGUN_DOMAIN'), - 'secret' => env('MAILGUN_SECRET'), - 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), - 'scheme' => 'https', - ], - - 'postmark' => [ - 'token' => env('POSTMARK_TOKEN'), - ], - - 'ses' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - ], - -]; diff --git a/run/laravel/config/session.php b/run/laravel/config/session.php deleted file mode 100644 index 1b99f221c6..0000000000 --- a/run/laravel/config/session.php +++ /dev/null @@ -1,201 +0,0 @@ - env('SESSION_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ - - 'lifetime' => env('SESSION_LIFETIME', 120), - - 'expire_on_close' => false, - - /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | - */ - - 'encrypt' => false, - - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ - - 'files' => storage_path('framework/sessions'), - - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ - - 'connection' => env('SESSION_CONNECTION'), - - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ - - 'table' => 'sessions', - - /* - |-------------------------------------------------------------------------- - | Session Cache Store - |-------------------------------------------------------------------------- - | - | While using one of the framework's cache driven session backends you may - | list a cache store that should be used for these sessions. This value - | must match with one of the application's configured cache "stores". - | - | Affects: "apc", "dynamodb", "memcached", "redis" - | - */ - - 'store' => env('SESSION_STORE'), - - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ - - 'lottery' => [2, 100], - - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ - - 'cookie' => env( - 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' - ), - - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ - - 'path' => '/', - - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ - - 'domain' => env('SESSION_DOMAIN'), - - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you when it can't be done securely. - | - */ - - 'secure' => env('SESSION_SECURE_COOKIE'), - - /* - |-------------------------------------------------------------------------- - | HTTP Access Only - |-------------------------------------------------------------------------- - | - | Setting this value to true will prevent JavaScript from accessing the - | value of the cookie and the cookie will only be accessible through - | the HTTP protocol. You are free to modify this option if needed. - | - */ - - 'http_only' => true, - - /* - |-------------------------------------------------------------------------- - | Same-Site Cookies - |-------------------------------------------------------------------------- - | - | This option determines how your cookies behave when cross-site requests - | take place, and can be used to mitigate CSRF attacks. By default, we - | will set this value to "lax" since this is a secure default value. - | - | Supported: "lax", "strict", "none", null - | - */ - - 'same_site' => 'lax', - -]; diff --git a/run/laravel/config/view.php b/run/laravel/config/view.php deleted file mode 100644 index 22b8a18d32..0000000000 --- a/run/laravel/config/view.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - resource_path('views'), - ], - - /* - |-------------------------------------------------------------------------- - | Compiled View Path - |-------------------------------------------------------------------------- - | - | This option determines where all the compiled Blade templates will be - | stored for your application. Typically, this is within the storage - | directory. However, as usual, you are free to change this value. - | - */ - - 'compiled' => env( - 'VIEW_COMPILED_PATH', - realpath(storage_path('framework/views')) - ), - -]; diff --git a/run/laravel/database/.gitignore b/run/laravel/database/.gitignore deleted file mode 100644 index 9b19b93c9f..0000000000 --- a/run/laravel/database/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.sqlite* diff --git a/run/laravel/database/factories/ProductFactory.php b/run/laravel/database/factories/ProductFactory.php deleted file mode 100644 index 7156a72cd4..0000000000 --- a/run/laravel/database/factories/ProductFactory.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -class ProductFactory extends Factory -{ - /** - * Define the model's default state. - * - * @return array - */ - public function definition() - { - return [ - 'name' => ucwords(fake()->safeColorName() . ' ' . fake()->word()), - 'description' => fake()->sentence() - ]; - } -} diff --git a/run/laravel/database/factories/UserFactory.php b/run/laravel/database/factories/UserFactory.php deleted file mode 100644 index 20b35322dd..0000000000 --- a/run/laravel/database/factories/UserFactory.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class UserFactory extends Factory -{ - /** - * Define the model's default state. - * - * @return array - */ - public function definition() - { - return [ - 'name' => fake()->name(), - 'email' => fake()->safeEmail(), - 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password - 'remember_token' => Str::random(10), - ]; - } - - /** - * Indicate that the model's email address should be unverified. - * - * @return static - */ - public function unverified() - { - return $this->state(function (array $attributes) { - return [ - 'email_verified_at' => null, - ]; - }); - } -} diff --git a/run/laravel/database/migrations/2014_10_12_000000_create_users_table.php b/run/laravel/database/migrations/2014_10_12_000000_create_users_table.php deleted file mode 100644 index 957b6ad8e2..0000000000 --- a/run/laravel/database/migrations/2014_10_12_000000_create_users_table.php +++ /dev/null @@ -1,35 +0,0 @@ -id(); - $table->string('name'); - $table->string('email')->unique(); - $table->timestamp('email_verified_at')->nullable(); - $table->string('password'); - $table->rememberToken(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('users'); - } -}; diff --git a/run/laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php b/run/laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php deleted file mode 100644 index 47f5a296d3..0000000000 --- a/run/laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ /dev/null @@ -1,31 +0,0 @@ -string('email')->index(); - $table->string('token'); - $table->timestamp('created_at')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('password_resets'); - } -}; diff --git a/run/laravel/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/run/laravel/database/migrations/2019_08_19_000000_create_failed_jobs_table.php deleted file mode 100644 index 5e9a296ed7..0000000000 --- a/run/laravel/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ /dev/null @@ -1,35 +0,0 @@ -id(); - $table->string('uuid')->unique(); - $table->text('connection'); - $table->text('queue'); - $table->longText('payload'); - $table->longText('exception'); - $table->timestamp('failed_at')->useCurrent(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('failed_jobs'); - } -}; diff --git a/run/laravel/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/run/laravel/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php deleted file mode 100644 index e65413a581..0000000000 --- a/run/laravel/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ /dev/null @@ -1,35 +0,0 @@ -id(); - $table->morphs('tokenable'); - $table->string('name'); - $table->string('token', 64)->unique(); - $table->text('abilities')->nullable(); - $table->timestamp('last_used_at')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('personal_access_tokens'); - } -}; diff --git a/run/laravel/database/migrations/2022_07_01_000000_create_products_table.php b/run/laravel/database/migrations/2022_07_01_000000_create_products_table.php deleted file mode 100644 index b2c753b697..0000000000 --- a/run/laravel/database/migrations/2022_07_01_000000_create_products_table.php +++ /dev/null @@ -1,32 +0,0 @@ -id(); - $table->string('name'); - $table->text('description'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('products'); - } -}; diff --git a/run/laravel/database/seeders/DatabaseSeeder.php b/run/laravel/database/seeders/DatabaseSeeder.php deleted file mode 100644 index cf8374da00..0000000000 --- a/run/laravel/database/seeders/DatabaseSeeder.php +++ /dev/null @@ -1,23 +0,0 @@ -create(); - - // \App\Models\User::factory()->create([ - // 'name' => 'Test User', - // 'email' => 'test@example.com', - // ]); - } -} diff --git a/run/laravel/database/seeders/ProductSeeder.php b/run/laravel/database/seeders/ProductSeeder.php deleted file mode 100644 index eee1bca2e8..0000000000 --- a/run/laravel/database/seeders/ProductSeeder.php +++ /dev/null @@ -1,21 +0,0 @@ -count(10) - ->create(); - } -} diff --git a/run/laravel/index.php b/run/laravel/index.php deleted file mode 100644 index 1dac2b2301..0000000000 --- a/run/laravel/index.php +++ /dev/null @@ -1,4 +0,0 @@ - 'These credentials do not match our records.', - 'password' => 'The provided password is incorrect.', - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', - -]; diff --git a/run/laravel/lang/en/pagination.php b/run/laravel/lang/en/pagination.php deleted file mode 100644 index d481411877..0000000000 --- a/run/laravel/lang/en/pagination.php +++ /dev/null @@ -1,19 +0,0 @@ - '« Previous', - 'next' => 'Next »', - -]; diff --git a/run/laravel/lang/en/passwords.php b/run/laravel/lang/en/passwords.php deleted file mode 100644 index 2345a56b5a..0000000000 --- a/run/laravel/lang/en/passwords.php +++ /dev/null @@ -1,22 +0,0 @@ - 'Your password has been reset!', - 'sent' => 'We have emailed your password reset link!', - 'throttled' => 'Please wait before retrying.', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that email address.", - -]; diff --git a/run/laravel/lang/en/validation.php b/run/laravel/lang/en/validation.php deleted file mode 100644 index cef02f589e..0000000000 --- a/run/laravel/lang/en/validation.php +++ /dev/null @@ -1,170 +0,0 @@ - 'The :attribute must be accepted.', - 'accepted_if' => 'The :attribute must be accepted when :other is :value.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute must only contain letters.', - 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'The :attribute must only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', - 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', - 'between' => [ - 'array' => 'The :attribute must have between :min and :max items.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'numeric' => 'The :attribute must be between :min and :max.', - 'string' => 'The :attribute must be between :min and :max characters.', - ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'current_password' => 'The password is incorrect.', - 'date' => 'The :attribute is not a valid date.', - 'date_equals' => 'The :attribute must be a date equal to :date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'declined' => 'The :attribute must be declined.', - 'declined_if' => 'The :attribute must be declined when :other is :value.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', - 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values.', - 'enum' => 'The selected :attribute is invalid.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'gt' => [ - 'array' => 'The :attribute must have more than :value items.', - 'file' => 'The :attribute must be greater than :value kilobytes.', - 'numeric' => 'The :attribute must be greater than :value.', - 'string' => 'The :attribute must be greater than :value characters.', - ], - 'gte' => [ - 'array' => 'The :attribute must have :value items or more.', - 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be greater than or equal to :value.', - 'string' => 'The :attribute must be greater than or equal to :value characters.', - ], - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'lt' => [ - 'array' => 'The :attribute must have less than :value items.', - 'file' => 'The :attribute must be less than :value kilobytes.', - 'numeric' => 'The :attribute must be less than :value.', - 'string' => 'The :attribute must be less than :value characters.', - ], - 'lte' => [ - 'array' => 'The :attribute must not have more than :value items.', - 'file' => 'The :attribute must be less than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be less than or equal to :value.', - 'string' => 'The :attribute must be less than or equal to :value characters.', - ], - 'mac_address' => 'The :attribute must be a valid MAC address.', - 'max' => [ - 'array' => 'The :attribute must not have more than :max items.', - 'file' => 'The :attribute must not be greater than :max kilobytes.', - 'numeric' => 'The :attribute must not be greater than :max.', - 'string' => 'The :attribute must not be greater than :max characters.', - ], - 'mimes' => 'The :attribute must be a file of type: :values.', - 'mimetypes' => 'The :attribute must be a file of type: :values.', - 'min' => [ - 'array' => 'The :attribute must have at least :min items.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'numeric' => 'The :attribute must be at least :min.', - 'string' => 'The :attribute must be at least :min characters.', - ], - 'multiple_of' => 'The :attribute must be a multiple of :value.', - 'not_in' => 'The selected :attribute is invalid.', - 'not_regex' => 'The :attribute format is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'password' => [ - 'letters' => 'The :attribute must contain at least one letter.', - 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', - 'numbers' => 'The :attribute must contain at least one number.', - 'symbols' => 'The :attribute must contain at least one symbol.', - 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', - ], - 'present' => 'The :attribute field must be present.', - 'prohibited' => 'The :attribute field is prohibited.', - 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', - 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', - 'prohibits' => 'The :attribute field prohibits :other from being present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_array_keys' => 'The :attribute field must contain entries for: :values.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values are present.', - 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ - 'array' => 'The :attribute must contain :size items.', - 'file' => 'The :attribute must be :size kilobytes.', - 'numeric' => 'The :attribute must be :size.', - 'string' => 'The :attribute must be :size characters.', - ], - 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid timezone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute must be a valid URL.', - 'uuid' => 'The :attribute must be a valid UUID.', - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - - 'custom' => [ - 'attribute-name' => [ - 'rule-name' => 'custom-message', - ], - ], - - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap our attribute placeholder - | with something more reader friendly such as "E-Mail Address" instead - | of "email". This simply helps us make our message more expressive. - | - */ - - 'attributes' => [], - -]; diff --git a/run/laravel/laravel-demo-screenshot.png b/run/laravel/laravel-demo-screenshot.png deleted file mode 100644 index e817bea3dc..0000000000 Binary files a/run/laravel/laravel-demo-screenshot.png and /dev/null differ diff --git a/run/laravel/package.json b/run/laravel/package.json deleted file mode 100644 index eaf1feecb7..0000000000 --- a/run/laravel/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "private": true, - "scripts": { - "dev": "vite", - "build": "vite build", - "update-static": "vite build && gcloud storage cp --recursive public/* gs://${ASSET_BUCKET}" - - }, - "devDependencies": { - "axios": "^0.25", - "laravel-vite-plugin": "^0.4.0", - "lodash": "^4.17.19", - "postcss": "^8.1.14", - "vite": "^2.9.11" - } -} \ No newline at end of file diff --git a/run/laravel/phpunit.xml b/run/laravel/phpunit.xml deleted file mode 100644 index fe977132e1..0000000000 --- a/run/laravel/phpunit.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - tests/Feature - - - - - ./app - - - - - - - - - - - - - - - diff --git a/run/laravel/public/.htaccess b/run/laravel/public/.htaccess deleted file mode 100644 index 3aec5e27e5..0000000000 --- a/run/laravel/public/.htaccess +++ /dev/null @@ -1,21 +0,0 @@ - - - Options -MultiViews -Indexes - - - RewriteEngine On - - # Handle Authorization Header - RewriteCond %{HTTP:Authorization} . - RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] - - # Redirect Trailing Slashes If Not A Folder... - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_URI} (.+)/$ - RewriteRule ^ %1 [L,R=301] - - # Send Requests To Front Controller... - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^ index.php [L] - diff --git a/run/laravel/public/favicon.ico b/run/laravel/public/favicon.ico deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/run/laravel/public/index.php b/run/laravel/public/index.php deleted file mode 100644 index f3c2ebcd37..0000000000 --- a/run/laravel/public/index.php +++ /dev/null @@ -1,55 +0,0 @@ -make(Kernel::class); - -$response = $kernel->handle( - $request = Request::capture() -)->send(); - -$kernel->terminate($request, $response); diff --git a/run/laravel/public/robots.txt b/run/laravel/public/robots.txt deleted file mode 100644 index eb0536286f..0000000000 --- a/run/laravel/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -Disallow: diff --git a/run/laravel/resources/css/app.css b/run/laravel/resources/css/app.css deleted file mode 100644 index d8dccfd77c..0000000000 --- a/run/laravel/resources/css/app.css +++ /dev/null @@ -1,19 +0,0 @@ -.wide { - /* col-xs-12 col-sm-12 col-md-12 */ - flex: 0 0 auto; - width: 100%; -} - -.action { - /* pt-3 text-center */ - padding-top: 1rem!important; - text-align: center!important; -} - -.col-form-label { - font-weight: bold; -} - -.display-data { - padding-top: calc(0.375rem + 1px); -} \ No newline at end of file diff --git a/run/laravel/resources/js/app.js b/run/laravel/resources/js/app.js deleted file mode 100644 index e59d6a0adf..0000000000 --- a/run/laravel/resources/js/app.js +++ /dev/null @@ -1 +0,0 @@ -import './bootstrap'; diff --git a/run/laravel/resources/js/bootstrap.js b/run/laravel/resources/js/bootstrap.js deleted file mode 100644 index d21a8c0f28..0000000000 --- a/run/laravel/resources/js/bootstrap.js +++ /dev/null @@ -1,34 +0,0 @@ -import _ from 'lodash'; -window._ = _; - -/** - * We'll load the axios HTTP library which allows us to easily issue requests - * to our Laravel back-end. This library automatically handles sending the - * CSRF token as a header based on the value of the "XSRF" token cookie. - */ - -import axios from 'axios'; -window.axios = axios; - -window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; - -/** - * Echo exposes an expressive API for subscribing to channels and listening - * for events that are broadcast by Laravel. Echo and event broadcasting - * allows your team to easily build robust real-time web applications. - */ - -// import Echo from 'laravel-echo'; - -// import Pusher from 'pusher-js'; -// window.Pusher = Pusher; - -// window.Echo = new Echo({ -// broadcaster: 'pusher', -// key: import.meta.env.VITE_PUSHER_APP_KEY, -// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, -// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, -// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, -// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', -// enabledTransports: ['ws', 'wss'], -// }); diff --git a/run/laravel/resources/views/products/create.blade.php b/run/laravel/resources/views/products/create.blade.php deleted file mode 100644 index 3d71cb69d1..0000000000 --- a/run/laravel/resources/views/products/create.blade.php +++ /dev/null @@ -1,32 +0,0 @@ -@extends('products.layout') - -@section('title') -Create New Product -@endsection - -@section('content') - -
- @csrf - -
- -
- -
-
- -
- -
- -
-
-
- - Back -
- - -
-@endsection \ No newline at end of file diff --git a/run/laravel/resources/views/products/edit.blade.php b/run/laravel/resources/views/products/edit.blade.php deleted file mode 100644 index 40e0a424df..0000000000 --- a/run/laravel/resources/views/products/edit.blade.php +++ /dev/null @@ -1,35 +0,0 @@ -@extends('products.layout') - -@section('title') -Edit Product #{{$product->id}} -@endsection - -@section('actions') -Back -@endsection - -@section('content') - -
- @csrf - @method('PUT') - -
- -
- -
-
- -
- -
- -
-
-
- -
- -
-@endsection \ No newline at end of file diff --git a/run/laravel/resources/views/products/index.blade.php b/run/laravel/resources/views/products/index.blade.php deleted file mode 100644 index 6e028fc4e6..0000000000 --- a/run/laravel/resources/views/products/index.blade.php +++ /dev/null @@ -1,45 +0,0 @@ -@extends('products.layout') - -@section('title') -Products -@endsection - -@section('actions') - Create New Product -@endsection - -@section('content') -@if (count($products) > 0) - - - - - - - - @foreach ($products as $product) - - - - - - - @endforeach -
IDNameDescriptionActions
{{ $product->id }}{{ $product->name }}{{ $product->description }} -
- - Edit - - @csrf - @method('DELETE') - - -
-
-@else -

No products. Create one. - @endif - - {!! $products->links() !!} - - @endsection \ No newline at end of file diff --git a/run/laravel/resources/views/products/layout.blade.php b/run/laravel/resources/views/products/layout.blade.php deleted file mode 100644 index e4dc6bb556..0000000000 --- a/run/laravel/resources/views/products/layout.blade.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Laravel Demo App Products - - - - - - -

-
-
-
-

@yield('title')

-
-
- @yield('actions') -
-
-
- - @if ($errors->any()) -
- Uh-oh! There was an error:

-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif - - @yield('content') -
- - - - \ No newline at end of file diff --git a/run/laravel/resources/views/products/show.blade.php b/run/laravel/resources/views/products/show.blade.php deleted file mode 100644 index cbfbba84c3..0000000000 --- a/run/laravel/resources/views/products/show.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -@extends('products.layout') - -@section('title') -Product #{{$product->id}} -@endsection - -@section('actions') -Back -Edit -@endsection - -@section('content') -
- -
- {{ $product->name }} -
-
- -
- -
- - {{ $product->description }} -
-
-@endsection \ No newline at end of file diff --git a/run/laravel/resources/views/welcome.blade.php b/run/laravel/resources/views/welcome.blade.php deleted file mode 100644 index f53aa43040..0000000000 --- a/run/laravel/resources/views/welcome.blade.php +++ /dev/null @@ -1,538 +0,0 @@ - - - - - - - - Laravel - - - - - - - - - - - -
- @if (Route::has('login')) - - @endif - -
-
- - - - - -
- ➡️ View the demo products page.
- ⬇️ View the system information. -
- -
- - - -
-
-
-
- - - - -
- -
-
- Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end. -
-
-
- -
-
- - - - - -
- -
-
- Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript development. Check them out, see for yourself, and massively level up your development skills in the process. -
-
-
- -
-
- - - - -
- -
-
- Laravel News is a community driven portal and newsletter aggregating all of the latest and most important news in the Laravel ecosystem, including new package releases and tutorials. -
-
-
- -
-
- - - -
Vibrant Ecosystem
-
- -
-
- Laravel's robust library of first-party tools and libraries, such as Forge, Vapor, Nova, and Envoyer help you take your projects to the next level. Pair them with powerful open source libraries like Cashier, Dusk, Echo, Horizon, Sanctum, Telescope, and more. -
-
-
-
-
- -
-
-
- - - - - - Shop - - - - - - - - Sponsor - -
-
- -
- - - Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}) -
Service: {{ $service }}. Revision {{ $revision }}. -
Project: {{ $project }}. Region {{ $region }}. - -
-
-
-
- - - \ No newline at end of file diff --git a/run/laravel/routes/api.php b/run/laravel/routes/api.php deleted file mode 100644 index eb6fa48c25..0000000000 --- a/run/laravel/routes/api.php +++ /dev/null @@ -1,19 +0,0 @@ -get('/user', function (Request $request) { - return $request->user(); -}); diff --git a/run/laravel/routes/channels.php b/run/laravel/routes/channels.php deleted file mode 100644 index 5d451e1fae..0000000000 --- a/run/laravel/routes/channels.php +++ /dev/null @@ -1,18 +0,0 @@ -id === (int) $id; -}); diff --git a/run/laravel/routes/console.php b/run/laravel/routes/console.php deleted file mode 100644 index e05f4c9a1b..0000000000 --- a/run/laravel/routes/console.php +++ /dev/null @@ -1,19 +0,0 @@ -comment(Inspiring::quote()); -})->purpose('Display an inspiring quote'); diff --git a/run/laravel/routes/web.php b/run/laravel/routes/web.php deleted file mode 100644 index 51c1dbf0b7..0000000000 --- a/run/laravel/routes/web.php +++ /dev/null @@ -1,45 +0,0 @@ - 'Unknown', - 'revision' => 'Unknown', - 'project' => 'Unknown', - 'region' => 'Unknown' - ]); - } - // [START cloudrun_laravel_display_metadata] - $metadata = new Google\Cloud\Core\Compute\Metadata(); - $longRegion = explode('/', $metadata->get('instance/region')); - - return view('welcome', [ - 'service' => env('K_SERVICE'), - 'revision' => env('K_REVISION'), - 'project' => $metadata->get('project/project-id'), - 'region' => end($longRegion), - ]); - // [END cloudrun_laravel_display_metadata] -}); - -// A basic CRUD example -Route::resource('products', ProductController::class); diff --git a/run/laravel/storage/app/.gitignore b/run/laravel/storage/app/.gitignore deleted file mode 100644 index 8f4803c056..0000000000 --- a/run/laravel/storage/app/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!public/ -!.gitignore diff --git a/run/laravel/storage/app/public/.gitignore b/run/laravel/storage/app/public/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/run/laravel/storage/app/public/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/run/laravel/storage/framework/.gitignore b/run/laravel/storage/framework/.gitignore deleted file mode 100644 index 05c4471f2b..0000000000 --- a/run/laravel/storage/framework/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -compiled.php -config.php -down -events.scanned.php -maintenance.php -routes.php -routes.scanned.php -schedule-* -services.json diff --git a/run/laravel/storage/framework/cache/.gitignore b/run/laravel/storage/framework/cache/.gitignore deleted file mode 100644 index 01e4a6cda9..0000000000 --- a/run/laravel/storage/framework/cache/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!data/ -!.gitignore diff --git a/run/laravel/storage/framework/cache/data/.gitignore b/run/laravel/storage/framework/cache/data/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/run/laravel/storage/framework/cache/data/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/run/laravel/storage/framework/sessions/.gitignore b/run/laravel/storage/framework/sessions/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/run/laravel/storage/framework/sessions/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/run/laravel/storage/framework/testing/.gitignore b/run/laravel/storage/framework/testing/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/run/laravel/storage/framework/testing/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/run/laravel/storage/framework/views/.gitignore b/run/laravel/storage/framework/views/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/run/laravel/storage/framework/views/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/run/laravel/storage/logs/.gitignore b/run/laravel/storage/logs/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/run/laravel/storage/logs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/run/laravel/tests/CreatesApplication.php b/run/laravel/tests/CreatesApplication.php deleted file mode 100644 index ab92402550..0000000000 --- a/run/laravel/tests/CreatesApplication.php +++ /dev/null @@ -1,22 +0,0 @@ -make(Kernel::class)->bootstrap(); - - return $app; - } -} diff --git a/run/laravel/tests/Feature/LandingPageTest.php b/run/laravel/tests/Feature/LandingPageTest.php deleted file mode 100644 index cb5ec2fcba..0000000000 --- a/run/laravel/tests/Feature/LandingPageTest.php +++ /dev/null @@ -1,15 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/run/laravel/tests/Feature/ProductTest.php b/run/laravel/tests/Feature/ProductTest.php deleted file mode 100644 index b4a25f7433..0000000000 --- a/run/laravel/tests/Feature/ProductTest.php +++ /dev/null @@ -1,44 +0,0 @@ -get('/products'); - - $response->assertStatus(200); - } - - public function test_product_create_page() - { - $response = $this->get('/products/create'); - - $response->assertStatus(200); - } - - public function test_create_product() - { - $response = $this->followingRedirects()->post('/products', [ - 'name' => 'Test Product', - 'description' => 'Test Description' - ]); - - $response->assertSuccessful(); - - $this->assertDatabaseCount('products', 1); - } - - public function test_database_seed() - { - $this->artisan('db:seed'); - - $response = $this->get('/products'); - $response->assertStatus(200); - } -} diff --git a/run/laravel/tests/TestCase.php b/run/laravel/tests/TestCase.php deleted file mode 100644 index 2932d4a69d..0000000000 --- a/run/laravel/tests/TestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -