Configurations
All configuration files in SigmaPHP are stored inside the
config/ directory located at the project root. The configuration
system is intentionally simple and predictable — no hidden magic, just
clean PHP arrays that you can fully control.
The framework ships with 3 main configuration categories: application configuration, database configuration and service providers configuration. You are also free to create your own configuration files and access them using SigmaPHP's dot notation helper.
Configuration values can be linked directly to environment variables
using the env() helper, allowing different setups for
development, staging, or production environments.
Configuration Basics
- App Config — defines core application behavior and paths.
- Database Config — controls migrations, models, and connections.
- Service Providers Config — manages the registration of service providers.
- Custom Configs — create your own files inside
config/. - Dot Notation — access values like
config('app.name'). - Helpers — use
config()andenv()anywhere. - .env Files — environment-specific configuration (dev, staging, production).
Application Configuration (config/app.php)
The application configuration defines global settings such as project identity, directory structure, routing behavior, and runtime environment.
name
Defines the application display name. This value is commonly used in templates, emails, logs, and system messages.
url
The main application URL. It can be used when generating absolute links, API calls, redirects, or external HTTP integrations.
env
Determines the current running environment such as
production, develop, or testing.
This allows environment-specific behavior like debugging or caching.
port
Defines the port number the application listens on for incoming requests.
Defaults to 8888 if not specified in the environment.
timezone
Sets the default timezone used for all date and time operations.
Defaults to UTC if not specified in the environment.
controllers_path
Specifies where controller classes are stored. SigmaPHP automatically loads controllers from this directory.
routes_path
Defines the location of route definition files. Organizing routes in a dedicated directory keeps application structure clean and maintainable.
middlewares_path
The directory path where application middleware files are stored. It is used to locate middleware classes.
views_path
Points to the directory containing template/view files rendered by the template engine.
cache_path
Location where compiled templates and cached files are stored to improve performance.
upload_path
Directory used to store uploaded files such as images, documents, or user assets.
commands_path
The directory path where console command files are stored. It is used to locate application console commands.
providers_path
The directory path where service provider files are stored. It is used to locate service providers responsible for registering and bootstrapping application services.
allow_http_method_override
Enables HTTP method overriding, allowing forms to simulate methods like
PUT, PATCH, or DELETE even when
browsers only support POST requests.
static_assets_route
Defines the route prefix used to serve static assets such as CSS, JavaScript, and images through the framework.
base_path
Used only when the application runs inside a sub-directory instead of the domain root. This helps SigmaPHP correctly generate internal URLs. Leave empty when the application is served from the root.
Database Configuration (config/database.php)
Database configuration controls migrations, seeders, models, and connection credentials. These settings allow SigmaPHP's ORM and CLI tools to operate consistently across environments.
path_to_migrations
Defines where migration files are stored. Migrations manage database schema changes in a structured and versioned way.
path_to_seeders
Directory containing seed classes used to populate the database with initial or testing data.
path_to_models
Specifies the location of application models used by the ORM layer.
logs_table_name
Name of the table used to track executed migrations and database history. This prevents migrations from running multiple times.
database_connection
Contains the database credentials required to establish a connection. Each value can be overridden using environment variables.
- host — database server hostname or IP address.
- user — database username.
- pass — database password.
- name — database schema name.
- port — database service port (default 3306).
Service Providers (config/providers.php)
The service providers configuration file is responsible for registering all service providers used by your application, including the built-in SigmaPHP framework providers and your own custom providers.
The SigmaPHP CLI provides utilities to register and manage service providers, so you don't need to update this file manually.
The configuration is organized into two sections:
- Core Service Providers: Contains the default service providers responsible for registering the framework's core services.
- User Defined Service Providers: Where you register your own application service providers.
You are not limited to the default configuration. For advanced customization, you can modify, replace, or even remove providers according to your application's requirements.
This is one of the things that makes SigmaPHP different: Zero magic, everything is controllable. You stay in control of how your application is configured and how its services are registered.
Environment Files (.env)
SigmaPHP reads environment variables from a .env file.
You may create multiple versions such as .env.dev,
.env.staging, or .env.production to match
your deployment workflow.
Values defined inside environment files can be accessed anywhere using
the env() helper, while application configuration values
are retrieved using the config() helper.