Download the PHP package stackkit/laravel-google-cloud-scheduler without Composer

On this page you can find all versions of the php package stackkit/laravel-google-cloud-scheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-google-cloud-scheduler

Run tests Latest Stable Version Downloads

Companion packages: Cloud Tasks, Cloud Logging

Introduction

This package allows you to use Google Cloud Scheduler to schedule Laravel commands.

How it works

Cloud Scheduler will make HTTP calls to your application. This package adds an endpoint to your application that accepts these HTTP calls with their payload (an Artisan command) and execute them.

There are two ways to schedule commands using this package:

1. Schedule the `schedule:run` command This is the easiest way to use this package. You can schedule the `schedule:run` command to run every minute.
2. Schedule commands separately If your application does not have commands that should run every minute, you may choose to schedule them individually. If the command uses `withoutOverlapping`, `before`, `after`, `onSuccess`, `thenPing`, etc, this package will respect those settings, as long as the command is also scheduled in the console kernel. For example, let's say we have to generate a report every day at 3:00 AM. We can schedule the `reports:generate` command to run at 3:00 AM using Cloud Scheduler. After the report is generated, OhDear should be pinged. Firstly, schedule the command in Cloud Tasks: Then, schedule the command in the console kernel: The package will pick up on the scheduled settings and ping OhDear after the command has run.

Requirements

This package requires Laravel 11 or 12.

Installation

1 - Require the package using Composer

2 - Define environment variables

CLOUD_SCHEDULER_APP_URL - This should be the URL defined in the URL field of your Cloud Scheduler job.

CLOUD_SCHEDULER_SERVICE_ACCOUNT - The e-mail address of the service account invocating the task.

Optionally, you may publish the configuration file:

3 - Ensure PHP executable is in open_basedir. This is required for the package to run Artisan commands.

How to find the executable:

4 - Optional, but highly recommended: server configuration

Since Artisan commands are now invoked via an HTTP request, you might encounter issues with timeouts. Here's how to adjust them:

5 - Optional, but highly recommended: set application RUNNING_IN_CONSOLE

Some Laravel service providers only register their commands if the application is being accessed through the command line (Artisan). Because we are calling Laravel scheduler from a HTTP call, that means some commands may never register, such as the Laravel Scout command:

To circumvent this, please add the following to bootstrap/app.php

6 - Optional: whitelist route for maintenance mode

If you want to allow jobs to keep running if the application is down (php artisan down), update the following:

Cloud Scheduler Example

Here is an example job that will run php artisan schedule:run every minute.

These are the most important settings:

Security

The job handler requires each request to have an OpenID token. Cloud Scheduler will generate an OpenID token and send it along with the job payload to the handler.

This package verifies that the token is digitally signed by Google and that it's meant for your application. Only Google Scheduler will be able to call your handler.

More information about OpenID Connect:

https://developers.google.com/identity/protocols/oauth2/openid-connect


All versions of laravel-google-cloud-scheduler with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
google/cloud-scheduler Version ^2.0
google/auth Version ^v1.29.1
laravel/framework Version ^11.0|^12.0
symfony/cache Version ^7.2
phpseclib/phpseclib Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stackkit/laravel-google-cloud-scheduler contains the following files

Loading the files please wait ....