mdbootstrap / adminlte-laravel

A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0
MIT License
1.81k stars 508 forks source link

Add to window.Laravel the logged user? #265

Open acacha opened 7 years ago

acacha commented 7 years ago

Maybe could be optional (config file)

Use:

<script>
        window.Laravel = {!! json_encode([
            'csrfToken' => csrf_token(),
            'user' => Auth::user()
        ]) !!};
    </script>

To htmlheader.blade.php partial.

acacha commented 7 years ago

Take into account window.Laravel is removed/deprecated in new Laravel versions

acacha commented 7 years ago

Why this change?

https://github.com/acacha/vue-laravel-authorization