Configuration

Intoduction

Lamotivo uses the default configuration system of Laravel.

The default configuration file is config/lm.php, each option is well documented. In this article we will describe some important options.

Routing

Lamotivo is running under the /lm URL path prefix, e.g. http://localhost/lm. You are free to change this prefix according to your own needs by setting the lm.route.prefix value. It may be like /admin or /panel, or something less common. It's not advised to use the most common prefix, if your application should be hidden from prying eyes.

Each HTTP request of Lamotivo uses X-Robots-Tag with the value noindex, nofollow to avoid accidental hits in the index of search engines. So you do not need to put your secret URL prefix in the robots.txt file, as well.

Namespace

Lamotivo application is located in the App\Lm namespace and in the app/Lm directory, by default. You may customize it with the lm.route.namespace and lm.directory values.

Authentication

The lm.auth.guard configuration option is an authentication guard. You may change to your own custom guard that exists in the auth.guards or lm.auth.guards options.

Bootstrap

The other important file is app/Lm/bootstrap.php. This file contains some things to bootstrap the application, such as menu generation and registering additional assets.

lm()->menu()->component(App\Lm\Components\Dashboard::class);
lm()->menu()->resource(App\Lm\User::class);

These lines are adding the Dashboard component and the User resource to the main menu.

You are free to organize the main menu as you wish. The following code shows how to create a dropdown group:

lm()->menu()->group('Services and Products', function($menu) {
    $menu->resource(App\Lm\Service::class);
    $menu->resource(App\Lm\Product::class);
    $menu->resource(App\Lm\Category::class);
    $menu->resource(App\Lm\Tag::class);
});

To register additional assets:

lm()->registerAsset('css/custom.scss');
lm()->registerAsset('js/custom.js');

In the example above we are attaching some assets that will be bundled to other assets of the application.