git clone <repo-url>
cd <repo-directory>Ensure you have Composer and Node.js installed:
composer install
npm installCopy .env.example to .env and edit it:
cp .env.example .envUpdate values such as database settings and API keys.
php artisan key:generatephp artisan migratephp artisan queue:workphp artisan serveVisit: http://127.0.0.1:8000
npm run devnpm run build- Monitor
storage/logs/laravel.logfor errors. - Keep your
.envfile up to date with token and permission details. - Match your logic between dashboard and CLI when checking for pending uploads.
The ClearOldUploads command has been created and implemented. You can now run it from your terminal like this:
php artisan uploads:clear-oldTo clear files older than 24 hours (default):
php artisan uploads:clear-old --hours=48This command will look in the storage/app/public/uploads directory and delete any files whose last modified time is older than the specified threshold. You can add this command to your cron job scheduler for regular cleanup. For example, to run it daily:
This application uses Google Drive to store uploaded files. To enable this functionality, you need to configure Google API credentials.
1. Create a Google Cloud Project:
- Go to the Google Cloud Console.
- If you don't have a project, create a new one.
2. Enable the Google Drive API:
- In your project, navigate to "APIs & Services" > "Library".
- Search for "Google Drive API" and enable it.
3. Create OAuth 2.0 Credentials:
- Go to "APIs & Services" > "Credentials".
- Click "+ CREATE CREDENTIALS" and select "OAuth client ID".
- If prompted, configure the "OAuth consent screen" first.
- Choose "External" for User Type unless you have a Google Workspace account and only internal users will connect.
- Fill in the required app information (App name, User support email, Developer contact information). You can leave scopes blank for now.
- Add your domain under "Authorized domains" if applicable (e.g.,
yourdomain.com).
- Return to "Credentials" and create the OAuth client ID:
- Select "Web application" as the Application type.
- Give it a name (e.g., "Upload Drive-In Web Client").
- Under Authorized redirect URIs, click "+ ADD URI". This is crucial:
- The URI must be the full URL to the application's callback endpoint. The path is
/google-drive/callback. - You need to combine your application's base URL (defined as
APP_URLin your.envfile) with this path. - Examples:
- If using
ddevand your URL ishttps://upload-drive-in.ddev.site, the redirect URI is:https://upload-drive-in.ddev.site/google-drive/callback - If running locally with
php artisan serveon port 8000 (APP_URL=http://127.0.0.1:8000), the redirect URI is:http://127.0.0.1:8000/google-drive/callback - If deployed to
https://myapp.com, the redirect URI is:https://myapp.com/google-drive/callback
- If using
- Enter the exact URI corresponding to your setup. You can add multiple URIs if you have different environments (like development and production).
- The URI must be the full URL to the application's callback endpoint. The path is
- Click "CREATE".
4. Configure Your .env File:
-
After creating the credentials, Google will show you your Client ID and Client Secret.
-
Copy these values into your project's
.envfile:GOOGLE_DRIVE_CLIENT_ID=YOUR_CLIENT_ID_HERE GOOGLE_DRIVE_CLIENT_SECRET=YOUR_CLIENT_SECRET_HERE
-
Note: Google Drive root folder configuration is now managed per-user through the admin and employee dashboards. You no longer need to set a global root folder ID in your environment variables.
5. Connect Google Drive in the Application:
- After configuring your
.envfile, log in to the application as an admin. - Navigate to the admin dashboard.
- Click the "Connect Google Drive" button. This will redirect you to Google to authorize the application.
- Once authorized, you'll be redirected back, and the connection should be active.
For comprehensive configuration of caching, queues, and background job processing, see the Environment Configuration Guide.
This guide covers:
- File, database, and Redis caching setup
- Queue configuration and background job processing
- Production recommendations and validation procedures
- Environment cleanup and optimization
Redis can be used for improved caching and queue performance. For DDEV environments, Redis can be easily added as a service.
For detailed Redis setup instructions, see: DDEV Redis Setup Guide
Quick Setup:
- Ensure Redis configuration files exist (they should be included in the project)
- Restart DDEV:
ddev restart - Update your
.envfile:REDIS_HOST=redis REDIS_PASSWORD=null REDIS_PORT=6379 REDIS_CLIENT=predis # Optional: Use Redis for caching CACHE_STORE=redis # Optional: Use Redis for queues QUEUE_CONNECTION=redis
- Test the connection:
ddev artisan validate:cache-configuration
Redis provides better performance for caching and queue operations compared to file-based or database alternatives.
The application features an enhanced Google Drive status messaging system that provides clear, consolidated status information without contradictory messages.
Key Features:
- Single, clear status messages (Healthy, Authentication Required, Connection Issues, Not Connected)
- Automatic token refresh handling in the background
- Consistent status display across admin and employee interfaces
- Clear action guidance when user intervention is required
For detailed information, see:
- Google Drive Status Messaging Improvement - Complete feature documentation
- Google Drive Status Quick Reference - Developer quick reference
- Troubleshooting Guide - Comprehensive troubleshooting
Common Status Messages:
- ✅ Healthy: "Connection is working properly" - No action needed
- ❌ Authentication Required: "Please reconnect your account" - Click reconnect button
⚠️ Connection Issues: "Experiencing connectivity problems" - Wait and retry- ℹ️ Not Connected: "Account not connected" - Follow setup instructions