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:

  1. php artisan vendor:publish

We add two new providers to the file config/app.php by adding two new entries to the providers key:

  1. Zofe\Rapyd\RapydServiceProvider::class,
  2. 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:

  1. 'firebird' => [
  2. 'driver' => 'firebird',
  3. 'host' => env('DB_HOST', 'localhost'),
  4. 'port' => env('DB_PORT', '3050'),
  5. 'database' => env('DB_DATABASE', 'examples'),
  6. 'username' => env('DB_USERNAME', 'SYSDBA'),
  7. 'password' => env('DB_PASSWORD', 'masterkey'),
  8. 'charset' => env('DB_CHARSET', 'UTF8'),
  9. 'engine_version' => '3.0.0',
  10. ],

Since we will use our connection as the default connection, specify the following:

  1. '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:

  1. DB_CONNECTION=firebird
  2. DB_HOST=localhost
  3. DB_PORT=3050
  4. DB_DATABASE=examples
  5. DB_USERNAME=SYSDBA
  6. DB_PASSWORD=masterkey

Edit the config/rapyd.php configuration file to change the date and time formats to match those used in your locale:

  1. 'fields' => [
  2. 'attributes' => ['class' => 'form-control'],
  3. 'date' => [
  4. 'format' => 'Y-m-d',
  5. ],
  6. 'datetime' => [
  7. 'format' => 'Y-m-d H:i:s',
  8. 'store_as' => 'Y-m-d H:i:s',
  9. ],
  10. ],

That completes the initial configuration. Now we can start building the logic of the web application.