Skip to content

Instantly share code, notes, and snippets.

@reinink
Created October 30, 2020 10:43
Show Gist options
  • Save reinink/ff99740e102a1aa71333318e44cab665 to your computer and use it in GitHub Desktop.
Save reinink/ff99740e102a1aa71333318e44cab665 to your computer and use it in GitHub Desktop.
<?php
namespace App\Providers;
use Inertia\ServiceProvider;
use Illuminate\Http\Request;
class InertiaServiceProvider extends ServiceProvider
{
/**
* The root template that's loaded on the first page visit.
*
* @see https://inertiajs.com/server-side-setup#root-template
* @var string
*/
protected $rootView = 'app';
/**
* Determines the current asset version.
*
* @see https://inertiajs.com/asset-versioning
*
* @return string|null
*/
public function version(Request $request)
{
return parent::version($request);
}
/**
* Defines the props that are shared by default.
*
* @see https://inertiajs.com/shared-data
*
* @return array
*/
public function share(Request $request)
{
return array_merge(parent::share($request), [
// your data
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment