Download the PHP package revolution/laravel-google-photos without Composer

On this page you can find all versions of the php package revolution/laravel-google-photos. 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-photos

Google Photos API for Laravel

Maintainability Code Coverage Ask DeepWiki

A Laravel package providing seamless integration with the Google Photos Library API and Google Photos Picker API. Upload photos, manage albums, and interact with Google Photos directly from your Laravel applications.

Overview

This package enables Laravel applications to:

Important: Due to Google Photos API limitations, you can only access and manage content that was uploaded via your application. For accessing existing user photos, use the Google Photos Picker API.

Quick Start

1. Install the Package

2. Get Google API Credentials

  1. Visit the Google Cloud Console
  2. Enable Photos Library API and Google Photos Picker API
    ⚠️ Be careful not to select "Google Picker API" (different from Photos Picker API)
  3. Create OAuth 2.0 client credentials
  4. Set authorized redirect URIs for your application

3. Configure Laravel

Add to your config/services.php:

Edit config/google.php:

Add to your .env:

4. Quick Example

Requirements

Installation

Authentication

OAuth 2.0 Only

This package ONLY supports OAuth 2.0 authentication.

Service Account authentication is NOT supported
API Key authentication is NOT supported

Why OAuth 2.0 Only? The Google Photos API is designed for user-centric applications and requires user consent to access personal photo libraries. Google Photos API does not support Service Account or API Key authentication methods because:

  1. Privacy by Design: Photos are personal data requiring explicit user consent
  2. Google API Limitation: The Photos Library API only accepts OAuth 2.0 tokens
  3. User Context Required: All operations need to be performed on behalf of a specific user

OAuth Setup Guide

Step 1: Google Cloud Console Setup

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable these APIs:
    • Photos Library API (for uploading and managing photos)
    • Google Photos Picker API (for photo selection interface)
  4. Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client ID"
  5. Choose "Web application"
  6. Add your authorized redirect URIs (e.g., https://yourapp.com/auth/google/callback)

Step 2: Laravel Configuration

The 'access_type' => 'offline' setting is required to obtain refresh tokens for long-term access.

Step 3: OAuth Implementation with Laravel Socialite

Usage Examples

Upload Photos

Photos must be uploaded using a two-step process:

List Media Items

Create Album

List Albums

Update Album Title

Using with User Model Trait

Add the PhotosLibrary trait to your User model for cleaner syntax:

Google Photos Picker API

Use the Picker API to let users select existing photos from their Google Photos library:

Advanced Usage

PhotosLibraryClient Methods

This package delegates to the Google Photos Library PHP client and supports all its methods:

PagedListResponse

Methods like listMediaItems() and listAlbums() return a PagedListResponse for handling large result sets:

Error Handling

Extending with Macros

You can extend the Photos facade with custom methods:

FAQ

Can I use a Service Account?

No. Service Account authentication is not supported by the Google Photos API. The API requires OAuth 2.0 user consent because it deals with personal photo data.

Can I use an API Key?

No. API Key authentication is not supported by the Google Photos API. Only OAuth 2.0 authentication is available.

Why only OAuth 2.0?

Google Photos API is designed exclusively for user-centric applications. Since photos are personal data, Google requires explicit user consent through OAuth 2.0. This ensures users maintain control over their photo data and can revoke access at any time.

Can I access existing photos in a user's Google Photos library?

No, not directly. The Google Photos Library API only allows access to photos uploaded via your application. To work with existing user photos, you must use the Google Photos Picker API included in this package.

Do I need review for production use?

If you're only uploading to your own account during development, no review is needed. However, for production use with other users' accounts, Google requires app review for sensitive scopes.

What are the API limits?

Google Photos API has rate limits and quotas. See the official documentation for current limits.

Related Packages

Resources

License

MIT


⚠️ Important Note: This package can only access photos uploaded via your application. For accessing existing user photos, use the Google Photos Picker API functionality included in this package.


All versions of laravel-google-photos with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0||^12.0
revolution/laravel-google-sheets Version ^7.0
google/photos-library Version ^1.7
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 revolution/laravel-google-photos contains the following files

Loading the files please wait ....