Access Settings
Platform settings are embedded in the admin dashboard at/admin. You can view and update settings directly from the dashboard interface.
Available Settings
The platform provides several categories of settings:Authentication Settings
Control user authentication and account management:Registration Enabled
Type: Boolean
Default:
Default:
trueControls whether new users can register accounts on the platform.Password Reset Enabled
Type: Boolean
Default:
Default:
trueControls whether users can reset their passwords via email.Use Case: Disable registration when you want a closed platform. Disable password reset if you manage passwords through an external system.
AI Integration Settings
Configure artificial intelligence features for content generation:AI Provider
Type: String (
Default:
openai or gemini)Default:
openaiSelects which AI provider to use for content generation.Supported Providers:openai- OpenAI GPT modelsgemini- Google Gemini models
OpenAI API Key
Type: String (optional)
Default: EmptyAPI key for OpenAI integration. Required if AI provider is set to
Default: EmptyAPI key for OpenAI integration. Required if AI provider is set to
openai.Gemini API Key
Type: String (optional)
Default: EmptyAPI key for Google Gemini integration. Required if AI provider is set to
Default: EmptyAPI key for Google Gemini integration. Required if AI provider is set to
gemini.AI Daily Limit
Type: Integer (minimum: 1)
Default:
Default:
5Maximum number of AI generations per user per day. Admins have unlimited usage.Retrieving Settings
Settings are stored in thesettings table and retrieved through the Setting model:
Basic Retrieval
FromSetting.php:15-26:
Settings are cached for 1 hour (3600 seconds) for performance. The cache is automatically cleared when settings are updated.
Helper Methods
TheSetting model provides convenient helper methods:
Updating Settings
Settings can be updated through the admin dashboard or programmatically:Admin Dashboard Update
The settings form submits to/admin/settings (POST).
From web.php:136-161:
Programmatic Update
FromSetting.php:31-41:
Setting Types and Casting
Settings are stored as strings but automatically cast to the correct type: FromSetting.php:62-71:
Supported Types
- boolean: Cast to
true/false - integer: Cast to integer
- float: Cast to floating point number
- json: Parsed from JSON string to array
- string: Returned as-is (default)
AI Settings Deep Dive
How AI Integration Works
AI Usage Enforcement
FromAiController.php:26-38:
AI Provider Configuration
- OpenAI
- Google Gemini
Requirements:Model Used: GPT-4 or GPT-3.5-turbo (configured in
- Valid OpenAI API key
- Access to GPT models
- Set
ai_providertoopenai
AiService)Authentication Settings Deep Dive
Registration Control
When registration is disabled:- Registration form is hidden from the welcome page
- Registration routes return errors
- Invitation system continues to work for admins
Password Reset Control
When password reset is disabled:- “Forgot Password” link is hidden
- Password reset routes return errors
- Admins can still change passwords in user management
External Authentication: If you use external authentication (OAuth, SSO, LDAP), you may want to disable both registration and password reset features.
Database Schema
Settings are stored in thesettings table:
Example Records
Cache Management
Settings are cached for performance but can be manually cleared:Setting.php:76-83:
Cache is automatically cleared when settings are updated via
Setting::set(). Manual clearing is only needed for debugging or after direct database modifications.Best Practices
Security Considerations
Recommended Security Measures
- Encrypt API Keys: Consider using Laravel’s encryption for sensitive settings
- Audit Logging: Log all setting changes with admin user information
- Rate Limiting: AI generation route already has throttling (
throttle:10,1) - Regular Reviews: Periodically review AI usage patterns and adjust limits
Troubleshooting
Settings not taking effect
Settings not taking effect
Check:
- Cache has been cleared (
php artisan cache:clear) - Database record was actually updated
- No environment variables overriding settings
AI generation failing
AI generation failing
Verify:
- API key is valid and active
- AI provider setting matches the key provided
- User has
can_use_aienabled - User hasn’t exceeded daily limit
- API provider service is operational
Cannot update settings
Cannot update settings
Ensure:
- You’re logged in as admin
- Password was recently confirmed
- Form validation is passing
- Database connection is working
Related Documentation
User Management
Manage AI permissions for individual users
AI Tools
Learn about AI content generation features
Dashboard
Return to admin dashboard overview
