6.4.2. Configuration
Now we can get down to configuration. To get it started, execute the following command to create additional configuration files for the zofe/rapyd package:
php artisan vendor:publish
We add two new providers to the file config/app.php
by adding two new entries to the providers
key:
Zofe\Rapyd\RapydServiceProvider::class,
Firebird\FirebirdServiceProvider::class,
We proceed to the file config/databases.conf
(not to be confused with databases.conf in your Firebird server root!) that contains the database connection settings. Add the following lines to the connections
key:
'firebird' => [
'driver' => 'firebird',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3050'),
'database' => env('DB_DATABASE', 'examples'),
'username' => env('DB_USERNAME', 'SYSDBA'),
'password' => env('DB_PASSWORD', 'masterkey'),
'charset' => env('DB_CHARSET', 'UTF8'),
'engine_version' => '3.0.0',
],
Since we will use our connection as the default connection, specify the following:
'default' => env('DB_CONNECTION', 'firebird'),
Pay attention to the env
function that is used to read the environment variables of the application from the special .env
file located in the root directory of the project. Correct the following lines in the .env file:
DB_CONNECTION=firebird
DB_HOST=localhost
DB_PORT=3050
DB_DATABASE=examples
DB_USERNAME=SYSDBA
DB_PASSWORD=masterkey
Edit the config/rapyd.php
configuration file to change the date and time formats to match those used in your locale:
'fields' => [
'attributes' => ['class' => 'form-control'],
'date' => [
'format' => 'Y-m-d',
],
'datetime' => [
'format' => 'Y-m-d H:i:s',
'store_as' => 'Y-m-d H:i:s',
],
],
That completes the initial configuration. Now we can start building the logic of the web application.