Wiki

Clone wiki

suitcms / Configuration

Back To Home

Configuration

This section will explain about environment configuration and app configuration. Read Laravel Configuration for more detail about laravel configuration.

Environment Configuration

Environment Configuration is configuration that exists on .env file. There are some environment variables in addition default .env file of laravel. They are

  • MAIL_DRIVER, Mail driver used by app. The default value is log
  • MAIL_HOST, Mail host server used for smtp driver
  • MAIL_PORT, Mail port server used for smtp driver
  • MAIL_FROM_ADDRESS, The default from email address. The default value is null. This must be defined before sending an email otherwise app will raise an Exception.
  • MAIL_FROM_NAME, The default from name. The default value is null.
  • MAIL_USERNAME, Username used for smtp driver
  • MAIL_PASSWORD, Password used for smtp driver
  • MANDRILL_SECRET, Mandril secret key used for mandrill driver

If an App need additional environment variable please add into this file. For example, if you build an App that require facebook authentication you can add facebook id and facebook secret into this file. And don't forget to update .env.example so that other developer know what environment variables exist on the app.

App Configuration

App configuration is configuration files which are exists on config directory. Some app configuration file used environment variables which is defined on Environment Configuration. Here are list additional configuration file from default configuration file of laravel, some are laravel package configuration.

Captcha Configuration (captcha.php)

Captcha image processing configuration. For now just read the comment on each key and do some experiment to change it. The configuration was obtained from inside PHP code on simple captcha core.

Elfinder Configuration (elfinder.php)

This configuration generated by barryvdh/laravel-elfinder

Constant Configuration (constant.php)

This configuration file used for define PHP constant. The configuration used array key-value format. The key is for name of the constant and the value is for value of the constant.

#!php
<?php
return [
     // some constants
     'NEW_CONSTANT' => 'VALUE',
];

Suitcms Configuration (suitcms.php)

This configuration file used for other app configurations.

#!php
<?php
return [

    'site_name' => 'Suitcms', 

    'logo_url' => 'assets/admin/img/logo.png',

    'login_url' => 'secret/login',

    'logout_url' => 'secret/login',

    'prefix_url' => 'backend',

    'num_per_page' => 10,

    'lang' => [
        'en_US' => 'English',
    ],

    'site_css' => [
        'assets/css/main.min.css',    // for template in wysiwyg editor
    ],

    'layouts' => [
        'pages' => [
            'pages.default' => 'Simple Layout',
        ],
    ]
];
  • site_name, Used for display only and this configuration is not used on anywhere yet.
  • logo_url, Admin logo image
  • login_url, Used for login url link.
  • logout_url, Used for logout redirect link. Changed it to '/' or '' to redirect to homepage
  • prefix_url, Used for Admin page prefix. Make sure it doesn't collide with front end route. Because if it does admin route will be called instead of the front end route.
  • num_per_page, Used for number of data to be shown on module index if not used datatable. At current version, Suitcms still used datatable but at future datatable will not be used by default.
  • lang, Used for multi language. At current version, translation module was dropped need to be changed to be more simple.
  • site_css, CSS files which will be loaded in WYSIWYG editor. Put from frontend css
  • layouts, Used for layout collection for pages. If you want to modified default layout please modified this value. This value is used on Page Model.

Next: Database

Updated