koderia-creative-lab / laravel-google-workspace
A modern Laravel wrapper around google/apiclient for Google Workspace Admin Directory, Classroom, Calendar/Meet, and Drive.
Package info
github.com/Koderia-Creative-Lab/laravel-google-workspace
pkg:composer/koderia-creative-lab/laravel-google-workspace
v1.0.0
2026-11-30 08:41 UTC
Requires
- php: ^8.1|^8.2|^8.3
- google/apiclient: ^2.15
- illuminate/support: ^9.0|^10.0|^11.0
Requires (Dev)
- mockery/mockery: ^1.4
- orchestra/testbench: ^7.0|^8.0|^9.0
- phpunit/phpunit: ^9.5|^10.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A modern Laravel wrapper around google/apiclient for Admin Directory (users, passwords, groups, OUs, aliases), Google Classroom, Google Calendar / Meet, and Google Drive using Service Account Domain-Wide Delegation.
Installation
composer require koderia-creative-lab/laravel-google-workspace
Publish configuration:
php artisan vendor:publish --tag="google-workspace-config"
Configuration
Set the following environment variables in .env:
GOOGLE_SERVICE_ACCOUNT_JSON=/path/to/storage/app/google/service-account.json GOOGLE_CLIENT_SUBJECT=admin@yourdomain.com GOOGLE_WORKSPACE_TIMEZONE=Africa/Lagos
Usage
Admin Directory (Users, Passwords, Groups, OUs, Aliases)
use Koderia\GoogleWorkspace\Facades\GoogleWorkspace; $directory = GoogleWorkspace::directory(); // Create a user $directory->createUser('ada@domain.com', 'Ada', 'Lovelace', 'TempPass123!', '/Students', true, 'students@domain.com'); // Change password directly in Directory $directory->changePassword('ada@domain.com', 'NewStrongPass456!', changePasswordAtNextLogin: false); // Suspend / Unsuspend / Sign out active sessions $directory->suspendUser('ada@domain.com'); $directory->unsuspendUser('ada@domain.com'); $directory->signOutUser('ada@domain.com'); // Aliases & Organizational Units $directory->addAlias('ada@domain.com', 'ada.l@domain.com'); $directory->moveUserToOrgUnit('ada@domain.com', '/Alumni');
Google Classroom
$classroom = GoogleWorkspace::actingAs('lecturer@domain.com')->classroom(); $course = $classroom->createCourse('CSC 101', '2026/2027'); $classroom->addTeacher($course->getId(), 'lecturer@domain.com'); $classroom->addStudent($course->getId(), 'student@domain.com'); $classroom->createAssignment($course->getId(), 'Lab 1', 'Submit PDF report', '2026-12-15');
Google Calendar & Meet
$meetUrl = GoogleWorkspace::calendar()->createMeetEvent( title: 'Departmental Board Meeting', date: '2026-12-01', time: '10:00', durationMinutes: 60, attendeeEmails: ['hod@domain.com', 'dean@domain.com'] );
Google Drive
$folder = GoogleWorkspace::drive()->createFolder('Student Transcripts'); GoogleWorkspace::drive()->shareFile($folder->getId(), 'registrar@domain.com', 'writer');
Testing
vendor/bin/phpunit