3.0 documentation

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

  1. orchestra
  2. handles
  3. resources
  4. memorize
  5. messages
  6. redirect_with_errors
  7. redirect_with_messages
  8. get_meta
  9. set_meta

orchestra

Return orchestra.app instance.

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

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

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

Alias to App::make('orchestra.app')

handles

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

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

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

echo handles('orchestra::users');

Alias to Foundation::handles()

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.

resources

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

To route for a resources you would normally write the following:

echo handles('orchestra/foundation::resources/foo/create');

This can be shortern to:

echo resources('foo/create');

memorize

Return memory configuration associated to the request.

echo memorize('site.name');

Alias to Memory::get()

messages

Add a new flash messages for the following request.

messages('success', 'User has been created.');
messages('error', 'Unable to update the database!');

Alias to Messages::add()

get_meta

Get available meta data for current request:

get_meta('title');

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

get_meta('title', 'Home');

Alias to Meta::get()

set_meta

Set new meta data for current request:

set_meta('title', 'Welcome');

Alias to Meta::set()