Installation
Earmark is in private development. Installation will open up with the first public release.
Install the package
composer require pixelworxio/earmark
Wrap your page content
In your main layout, wrap the part of the page that changes from page to page:
<body>
<x-header />
<x-earmark>
{{ $slot }}
</x-earmark>
</body>
That is it. Earmark ships its own compiled script and styles and adds them to the page itself, so there is nothing to add to Vite, Tailwind or your JavaScript bundle.
Use wire:navigate
Earmark swaps pages without reloading, so your pages should be navigated with Livewire's wire:navigate. Earmark routes ordinary same-origin links through it automatically, so most apps work without changing a single link.
Publish the config (optional)
php artisan vendor:publish --tag="earmark-config"
This creates config/earmark.php, where you set the defaults for every visitor. See the configuration reference.
Database store (optional)
To have saved views follow signed-in users across devices, publish and run the migration, then set store to database:
php artisan vendor:publish --tag="earmark-migrations"
php artisan migrate
See Where views are stored for the details.