Docs / Inlay / Site Settings

Site settings

Content that belongs to the whole site - contact details, header links, footer text - is declared with the same Settings schema as a section and edited under Settings in the admin.

Declaring a group

In a service provider:

use WeArePixel\Inlay\Facades\Inlay;
use WeArePixel\Inlay\Schema\Settings;

Inlay::siteSettings('contact', Settings::make()
    ->text('phone')->label('Phone')->default('+61 400 000 000')
    ->text('email')->label('Email')
    ->textarea('address'), label: 'Contact details');

The handle (contact) is the first part of every key you read.

Reading values

<a href="tel:{{ Inlay::setting('contact.phone') }}">{{ Inlay::setting('contact.phone') }}</a>

@foreach (Inlay::setting('header.links', []) as $link)
    {{-- each repeater item, hydrated --}}
@endforeach
  • Inlay::setting('group.field', $default) returns one value. More dots reach nested values, e.g. header.cta.url.
  • Inlay::settings('group') returns the whole group as an array.

Values are hydrated like section settings: images to ImageValue, links to LinkValue, rich text sanitised.

No publish step

Site settings are live as soon as they're saved. There's no draft or revision history for them.

They're stored in inlay_site_settings. Run php artisan migrate after upgrading from a version without them.

Discovery Call

One call.
We'll both know.

20 minutes to walk through your project, ask the hard questions, and work out honestly if we're the right team for it.

  • One call per day - it gets our full attention
  • Australia's only Laravel Premier Partner
  • Trusted by Chemist Warehouse, HelloFresh and Youfoodz
  • Senior engineers only - no juniors on your project
  • Brisbane-based, onshore team

Press Esc to close  ·  B to reopen