3.3 documentation

Meta data are configuration information that are only available on current request. It similar to Laravel configuration repository but without the persistent information. This make it useful for adding information that is specific to the current request.

  1. Basic Usage
  2. Using Helpers
  3. Using Blade Directives

Basic Usage

A common usage of meta data is to define current page title:

Meta::set('title', 'Welcome');

This value can be retrieved via Meta::get():

echo Meta::get('title');

Using Helpers

Set a meta data:

set_meta('title', 'Welcome');

Get a meta data (this will return the value):

echo get_meta('title');

Using Blade Directives

Set a meta data:

@set_meta('title', 'Welcome')

Get a meta data (this will echo the value):

@get_meta('title')