Environment Configuration
Sistema de Abogados uses Laravel’s environment configuration system. All configuration is managed through the.env file located in the application root directory.
Never commit your
.env file to version control. It contains sensitive credentials and environment-specific settings.Application Settings
Basic Application Configuration
Configure the core application settings in your.env file:
.env
The name of your application, displayed in emails and the interface.
The application environment. Options:
local, development, staging, productionApplication encryption key. Generate using
php artisan key:generateEnable debug mode. Set to
false in production to prevent sensitive information leakage.The base URL of your application. Used for generating absolute URLs.
Logging Configuration
.env
Log channel to use. Options:
stack, single, daily, slack, stderr, syslogMinimum log level. Options:
debug, info, notice, warning, error, critical, alert, emergencyDatabase Configuration
MySQL Connection
Configure your MySQL database connection:.env
Database driver. Options:
mysql, pgsql, sqlite, sqlsrvDatabase host address. Use
127.0.0.1 for local development.Database port. MySQL default is
3306, PostgreSQL is 5432.Name of your database. Ensure this database exists before running migrations.
Database username with appropriate permissions.
Database password. Leave empty if no password is set (not recommended for production).
Database Configuration File
Advanced database settings are configured inconfig/database.php:
The application uses
utf8mb4 character set by default, which supports emoji and special characters.Mail Configuration
Configure email sending for notifications and user communications:.env
Mail driver. Options:
smtp, sendmail, mailgun, ses, postmark, log, arraySMTP server hostname. For development, use
mailpit or mailtrap.io.SMTP port. Common ports:
587 (TLS), 465 (SSL), 25 (unencrypted)Encryption type. Options:
tls, ssl, nullDefault “from” email address for all outgoing emails.
Production Mail Configuration Examples
- Gmail
- Mailgun
- AWS SES
.env
Use an App Password instead of your regular Gmail password.
Cache Configuration
Configure caching for improved performance:.env
Cache storage driver. Options:
file, redis, memcached, database, arraySession storage driver. Options:
file, cookie, database, redis, memcached, arraySession lifetime in minutes. Default is 2 hours.
Redis Configuration (Optional)
For high-performance caching and session storage:.env
Install the Redis PHP extension:
pecl install redisQueue Configuration
Configure background job processing:.env
Queue driver. Options:
sync, database, redis, sqs, beanstalkd, nullQueue Driver Options
- Sync (Development)
- Database
- Redis (Recommended)
.env
Spatie Permission Configuration
The application uses Spatie Laravel Permission for role-based access control. Configuration is located inconfig/permission.php:
Models
config/permission.php
Table Names
config/permission.php
Cache Configuration
config/permission.php
Default Roles
The system includes three predefined roles (seeded viaRoleSeeder):
Admin
Full system access and management
Abogado
Lawyer role with case management access
Asistente
Assistant role with limited permissions
Laravel Scout Configuration
Laravel Scout provides full-text search functionality. Configuration is inconfig/scout.php:
config/scout.php
Scout Driver Options
- Database (Simple)
- Algolia
- Meilisearch
- Collection (Development)
.env
Indexing Models
Index your searchable models:Broadcasting Configuration
For real-time features:.env
Broadcasting driver. Options:
pusher, redis, log, nullPusher Configuration (Optional)
.env
File Storage Configuration
.env
Default filesystem disk. Options:
local, public, s3AWS S3 Configuration (Optional)
.env
Security Configuration
Authentication
The application uses Laravel Sanctum for authentication:config/sanctum.php
CORS Configuration
Configure Cross-Origin Resource Sharing inconfig/cors.php:
config/cors.php
Performance Optimization
Production Optimization Commands
Run these commands before deploying to production:Clear All Caches
During development or after configuration changes:Configuration Files Reference
All configuration files are located in theconfig/ directory:
app.php
Application name, environment, debug mode, locale, timezone
auth.php
Authentication guards, providers, password reset settings
database.php
Database connections, migrations table, Redis configuration
mail.php
Mail drivers, SMTP settings, from address
cache.php
Cache stores, drivers, prefixes
queue.php
Queue connections, failed job settings
permission.php
Spatie permission models, tables, cache
scout.php
Search driver, queue, Algolia/Meilisearch settings
session.php
Session driver, lifetime, cookie settings
filesystems.php
Storage disks, S3 configuration
Environment-Specific Configuration
- Development
- Staging
- Production
.env
Next Steps
Creating Cases
Learn how to create and manage legal cases
Managing Expedientes
Guide to conciliation process management
Models Reference
Explore the data models and relationships
Controllers Reference
API controller documentation