Download the PHP package eibs/laravel-gmail-mailbox without Composer

On this page you can find all versions of the php package eibs/laravel-gmail-mailbox. 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-gmail-mailbox

Laravel Gmail Mailbox Package

Latest Version on Packagist Total Downloads License

A complete, plug-and-play Laravel package to integrate the Google Gmail API into any Laravel application with a responsive, modern Gmail-like Mailbox UI, OAuth 2.0 authentication, email viewer, composer, and thread reply support.


✨ Features


📋 Requirements


🚀 Installation

1. Install via Composer

(Optional: For local development repository, add this to your Laravel application's composer.json:)


2. Run Database Migrations

The package automatically loads its migrations to create the google_tokens table:

(Optional: Publish migrations if you wish to customize database columns)


3. Publish Configuration (Optional)

This creates config/gmail-mailbox.php where you can customize middleware, route prefix, master layout, and pagination.


🔑 Google Cloud Console Setup

  1. Visit the Google Cloud Console.
  2. Create a new project (or select an existing one).
  3. Navigate to APIs & Services > Library, search for Gmail API, and click Enable.
  4. Go to APIs & Services > OAuth consent screen:
    • Select External (or Internal for Workspace organizations).
    • Fill in App Name, User Support Email, and Developer Contact Email.
    • Under Scopes, add the Gmail API scopes (gmail.readonly, gmail.send, gmail.modify).
    • Under Test Users, add the Gmail address you will use to log in (if the app status is in Testing mode).
  5. Go to APIs & Services > Credentials:

    • Click Create Credentials > OAuth client ID.
    • Application type: Web application.
    • Authorized redirect URIs:

      (Replace http://localhost:8000 with your production APP_URL on live servers).

  6. Copy your Client ID and Client Secret and paste them into your .env file.

⚙️ Configuration & Environment Variables

Add the following variables to your .env file:


🔒 Authentication & Middleware Guide

The package is designed to work seamlessly in both unauthenticated (standalone/public) and authenticated applications.

Case A: Projects WITHOUT Authentication (Default)

By default, the package uses ['web'] middleware. You do not need Laravel Breeze, Jetstream, or any login system. Users can access the mailbox routes directly:

Case B: Projects WITH Authentication (Laravel Breeze / Jetstream / Custom Auth)

If your app has user authentication and you want to restrict the mailbox to logged-in users:

  1. Publish the config file:

  2. Open config/gmail-mailbox.php and add 'auth' to the middleware array:

Case C: Custom Roles or Guards (e.g., Admin only)

You can use any custom middleware or role guard:


🎨 Customizing Layout & Blade Views

1. Integrating into Your App's Master Layout

The mailbox views extend the layout defined in config/gmail-mailbox.php or GMAIL_MAILBOX_LAYOUT in .env:

Or in config/gmail-mailbox.php:

Your master layout should contain @yield('content') or standard Laravel content sections.

2. Customizing Blade Templates & UI

To customize the HTML, CSS, or structure of the inbox, email reader, and settings page, publish the views:

The views will be copied to resources/views/vendor/gmail-mailbox/:


🚦 Available Routes

Method URI Route Name Description
GET /gmail/inbox gmail.inbox Main Gmail Mailbox interface
GET /gmail/settings gmail.settings Account management & status screen
GET /gmail/auth gmail.auth Redirects to Google OAuth consent page (with account chooser)
GET /gmail/callback gmail.callback Google OAuth redirect callback
GET /gmail/switch/{id} gmail.switch Switch active Gmail mailbox account
POST /gmail/disconnect/{id?} gmail.disconnect Disconnect specific or active Google account
GET /gmail/email/{id} gmail.email.show Fetch email details (JSON / View)
POST /gmail/send gmail.send Send a new email with attachments
POST /gmail/reply/{id} gmail.reply Reply to an existing email thread
POST /gmail/read/{id} gmail.read Mark an email as read
GET /gmail/unread-count gmail.unread.count Returns JSON with unread email count
GET /gmail/attachment/{msgId}/{attId} gmail.attachment.download Download attachment file
POST /gmail/favorites/toggle gmail.favorites.toggle Toggle favorite / watched contact for notifications
GET /gmail/favorites gmail.favorites.list List all active favorite notification contacts
DELETE /gmail/favorites/{id} gmail.favorites.remove Remove a watched favorite contact
GET /gmail/notifications/check gmail.notifications.check Polling endpoint for favorite mail activity

(Note: If you change GMAIL_MAILBOX_PREFIX=mail in .env, the routes will be /mail/inbox, /mail/settings, etc.)


💻 Programmatic Usage (GmailService)

You can inject or resolve Queen\GmailMailbox\Services\GmailService to perform email and multi-account operations anywhere in your application:


📄 License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-gmail-mailbox with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
google/apiclient Version ^2.15
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 eibs/laravel-gmail-mailbox contains the following files

Loading the files please wait ...