Orchestra Platform includes a set of helpers function to help solves some of the frequent problem while developing on Laravel.

orchestra()

Return orchestra.app instance.

<?php

echo orchestra()->memory()->get('site.name');

# You can also use the following to get the same value

echo orchestra('memory')->get('site.name');

handles()

Return handles configuration for a package to generate a full URL.

<?php

echo handles('orchestra/foundation::users');

# You can also use `orchestra` as an alias to `orchestra/foundation`.

echo handles('orchestra::users');

Above code would return /admin/users, however if your Orchestra Platform configuration is set to use root path as the handles, the same code would then return /users.

๐Ÿ“˜

During boot process, Orchestra Platform will automatically set handle for each packages, if specified in orchestra.json to orchestra/extension::handles.vendor/package, this can be modified from the extension configuration page.

memorize()

Return memory configuration associated to the request.

<?php

echo memorize('site.name');

messages()

Add a new flash messages for the following request.

<?php

messages('success', 'User has been created.');

messages('error', 'Unable to update the database!');

get_meta()

Get available meta data for current request:

<?php

get_meta('title');

# You can also set a default value if key is not available

get_meta('title', 'Home');

set_meta()

Set new meta data for current request:

<?php

set_meta('title', 'Welcome');