Configuration

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 VariableAvailable ValuesDefaultDescription
DB_CONNECTIONstringsqlite
Database driver: `pgsql`, `mysql`, `sqlite`, `sqlserver`.
DB_HOSTstring127.0.0.1
Database server hostname or IP.
DB_PORTintegerby-driver
The database port, driver specific.
DB_DATABASEstringwod
The database name.
DB_USERNAMEstringwod
The database username.
DB_PASSWORDstringwod
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 VariableAvailable ValuesDefaultDescription
DB_DEFAULT_CONNECTIONstringdefault
The default database connection.
DB_DEFAULT_LOGGER?stringnull
Laravel logger channel, to log queries. Loggers can be added in `config/logging.php`
DB_USE_TELESCOPE_LOGGERbooleanfalse
When enabled, `QueryExecuted` event will be fired through `TelescopeLogger` class.
DB_MIGRATIONS_TABLEstringcycle_migrations
The table name for the migrations.
CYCLE_TOKENIZER_CACHE_TARGETSbooleantrue
Determines whether to cache located classes utilizing annotations.
CYCLE_TOKENIZER_LOAD_CLASSESbooleantrue
Controls whether files of type `class` should be loaded.
CYCLE_TOKENIZER_LOAD_ENUMSbooleanfalse
Controls whether files of type `enum` should be loaded.
CYCLE_TOKENIZER_LOAD_INTERFACESbooleanfalse
Controls whether files of type `interface` should be loaded.
CYCLE_ATTRIBUTES_CACHEbooleantrue
Determines whether located attributes should be cached.
CYCLE_ATTRIBUTES_CACHE_DRIVERstringfile
Specifies the cache driver to use, selectable from the stores defined in `config/cache.php`.
DB_DEFAULT_COLLECTIONstringilluminate
Sets the default collection implementation: `array`, `illuminate`, `doctrine`.
CYCLE_SCHEMA_WARMUPbooleantrue
Indicates whether the schema cache should be preloaded.
CYCLE_REGISTER_ENTITY_BEHAVIOURbooleantrue
Enables support of `SoftDelete` and other behaviours from cycle/entity-behavior