Configuration Guide
This guide provides essential post-installation configuration steps to optimize and enhance the performance of your ZenTutor Pro application.
Performance Optimization
1. Cache Configuration and Routes
To improve performance, run the following artisan commands:
php artisan config:cache
php artisan route:cache
php artisan view:cache
These commands will precompile configuration files, routes, and views to make the app run faster.
2. Optimize Autoloading
To optimize class loading, run:
composer install --no-dev --optimize-autoloader
This will remove development dependencies and optimize file loading.
Storage Configuration
Create a symbolic link to make storage files publicly accessible:
php artisan storage:link
If using cPanel without SSH access, you may need to create this link manually:
- Navigate to the
public
directory - Create a symbolic link named
storage
pointing to../storage/app/public
Queue Configuration (Optional)
Using queues will improve your application's performance, especially under high loads, such as when sending emails asynchronously.
To enable queues, update your .env
file:
QUEUE_CONNECTION=database
Then run the queue worker:
php artisan queue:work --daemon
For production environments, it's recommended to set up a process monitor like Supervisor to ensure the queue worker runs continuously.
Supervisor Configuration Example:
[program:zentutor-queue]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/your/project/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/path/to/your/project/storage/logs/worker.log
Advanced Logging
For better debugging and monitoring, you can customize logging in your .env
file:
LOG_CHANNEL=stack
LOG_LEVEL=debug
For production environments, consider changing the log level to error
or warning
to reduce log file size.
Logs can be found in:
storage/logs/laravel.log
Email Configuration
To enable email functionality (for password resets, notifications, etc.), update your .env
file:
MAIL_MAILER=smtp
MAIL_HOST=your-smtp-server.com
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=no-reply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"
Additional Configuration Options
1. Application Timezone
Set your application's timezone in .env
:
APP_TIMEZONE=America/New_York
Replace America/New_York
with your preferred timezone.
2. Default Language
Set your application's default language in .env
:
APP_LOCALE=en
3. Customizing Session Lifetime
By default, user sessions expire after 120 minutes of inactivity. To change this, update the SESSION_LIFETIME
value in your .env
file:
SESSION_LIFETIME=240
This example sets the session lifetime to 240 minutes (4 hours).
✅ Configuration complete! Your ZenTutor Pro app is now optimized and ready for use.