AsgardCms/Core

View on GitHub
Composers/CurrentUserViewComposer.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php namespace Modules\Core\Composers;

use Illuminate\Contracts\View\View;
use Modules\Core\Contracts\Authentication;

class CurrentUserViewComposer
{
    /**
     * @var Authentication
     */
    private $auth;

    public function __construct(Authentication $auth)
    {
        $this->auth = $auth;
    }

    public function compose(View $view)
    {
        $view->with('currentUser', $this->auth->check());
    }
}