diff --git a/app/Models/User.php b/app/Models/User.php index 48724efad..7892298fe 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -206,6 +206,14 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac return $rules; } + /** + * Return the user model in a format that can be passed over to Vue templates. + */ + public function toVueObject(): array + { + return Collection::make($this->toArray())->except(['id', 'external_id'])->toArray(); + } + /** * Send the password reset notification. * diff --git a/resources/views/templates/wrapper.blade.php b/resources/views/templates/wrapper.blade.php new file mode 100644 index 000000000..4c2705517 --- /dev/null +++ b/resources/views/templates/wrapper.blade.php @@ -0,0 +1,53 @@ + + + + {{ config('app.name') }} + + @section('meta') + + + + + + + + + + + + + + @show + + @section('user-data') + @if(!is_null(Auth::user())) + + @endif + @if(!empty($siteConfiguration)) + + @endif + @show + + + @yield('assets') + + @include('layouts.scripts') + + + @section('content') + @yield('above-container') + @yield('container') + @yield('below-container') + @show + @section('scripts') + {!! $asset->js('main.js') !!} + @show + +