Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to window.Laravel the logged user? #265

Open
acacha opened this issue May 18, 2017 · 2 comments
Open

Add to window.Laravel the logged user? #265

acacha opened this issue May 18, 2017 · 2 comments
Assignees

Comments

@acacha
Copy link
Collaborator

acacha commented May 18, 2017

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 acacha self-assigned this May 18, 2017
@acacha
Copy link
Collaborator Author

acacha commented May 20, 2017

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

@acacha
Copy link
Collaborator Author

acacha commented May 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant