Configuration
This section guides you through configuring the Laravel-CycleORM-Adapter package within your Laravel application. Configuration settings are managed in the config/cycle.php
file. Ensure you have this file in your project by following the steps outlined in the Installation guide.
🌎 Environment Variables
Database Connection Variables
This section details the environment variables for database connections. Our package uses Laravel's standard variables and introduces additional settings for CycleORM integration. Configure these in your .env
file as needed or override them in your config/cycle.php
file.
These are variables, that will be in .env
file of your Laravel project from the box, and are used by config/cycle.php
to configure CycleORM.
Environment Variable | Available Values | Default | Description |
---|---|---|---|
DB_CONNECTION | string | sqlite | Database driver: `pgsql`, `mysql`, `sqlite`, `sqlserver`. |
DB_HOST | string | 127.0.0.1 | Database server hostname or IP. |
DB_PORT | integer | by-driver | The database port, driver specific. |
DB_DATABASE | string | wod | The database name. |
DB_USERNAME | string | wod | The database username. |
DB_PASSWORD | string | wod | The database password. |
Additional Variables
These variables offer further customization for CycleORM's operation within Laravel.
Add these manually in your .env
file to modify default behaviors, or use the config/cycle.php
file to override
them.
Environment Variable | Available Values | Default | Description |
---|---|---|---|
DB_DEFAULT_CONNECTION | string | default | The default database connection. |
DB_DEFAULT_LOGGER | ?string | null | Laravel logger channel, to log queries. Loggers can be added in `config/logging.php` |
DB_USE_TELESCOPE_LOGGER | boolean | false | When enabled, `QueryExecuted` event will be fired through `TelescopeLogger` class. |
DB_MIGRATIONS_TABLE | string | cycle_migrations | The table name for the migrations. |
CYCLE_TOKENIZER_CACHE_TARGETS | boolean | true | Determines whether to cache located classes utilizing annotations. |
CYCLE_TOKENIZER_LOAD_CLASSES | boolean | true | Controls whether files of type `class` should be loaded. |
CYCLE_TOKENIZER_LOAD_ENUMS | boolean | false | Controls whether files of type `enum` should be loaded. |
CYCLE_TOKENIZER_LOAD_INTERFACES | boolean | false | Controls whether files of type `interface` should be loaded. |
CYCLE_ATTRIBUTES_CACHE | boolean | true | Determines whether located attributes should be cached. |
CYCLE_ATTRIBUTES_CACHE_DRIVER | string | file | Specifies the cache driver to use, selectable from the stores defined in `config/cache.php`. |
DB_DEFAULT_COLLECTION | string | illuminate | Sets the default collection implementation: `array`, `illuminate`, `doctrine`. |
CYCLE_SCHEMA_WARMUP | boolean | true | Indicates whether the schema cache should be preloaded. |
CYCLE_REGISTER_ENTITY_BEHAVIOUR | boolean | true | Enables support of `SoftDelete` and other behaviours from cycle/entity-behavior |