laravel-google-sheet-i18n

Setting up Google Sheets API

To use this package, you need a Google Cloud Project with the Sheets API enabled and a Service Account.

1. Create a Google Cloud Project

  1. Go to the Google Cloud Console. Create Project Button
  2. Create a new project (e.g., laravel-i18n). Project Creation

2. Enable Google Sheets API

  1. In the sidebar, go to APIs & Services > Library. Enable APIs
  2. Search for “Google Sheets API”. API Library
  3. Click Enable. Enable Button

3. Create a Service Account

  1. Go to APIs & Services > Credentials. Credentials Page
  2. Click Create Credentials > Service Account. Create Service Account Menu
  3. Name it (e.g., laravel-translator) and click Create. Service Account Form

4. Download Service Account Key

  1. Find your new Service Account in the list and copy its email address (you’ll need this later). Then click on the email to open details. Copy Email Service Account Details
  2. Go to the Keys tab. Keys Tab
  3. Click Add Key > Create new key. Add Key
  4. Select JSON and click Create. A file will download. Key Downloaded

5. Share Your Google Sheet

  1. Create a new Google Sheet. Fresh Sheet
  2. Click Share and add the Service Account Email you copied earlier as an Editor. Share with Service Account

6. Configure Laravel

  1. Put the downloaded JSON file in your project (e.g., storage/app/google-service-account.json).
  2. Get your Spreadsheet ID from the URL. Sheet ID
  3. Update your .env file:
    GOOGLE_SHEET_I18N_ID=your_spreadsheet_id
    GOOGLE_APPLICATION_CREDENTIALS=storage/app/google-service-account.json