Cachet/app/Composers/CurrentUserComposer.php
2017-12-03 17:34:59 +00:00

39 lines
861 B
PHP

<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Composers;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Auth;
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;
/**
* This is the current user composer class.
*
* @author Joseph Cohen <joe@alt-three.com>
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class CurrentUserComposer
{
/**
* Bind data to the view.
*
* @param \Illuminate\Contracts\View\View $view
*
* @return void
*/
public function compose(View $view)
{
$view->withCurrentUser(AutoPresenter::decorate(Auth::user()));
}
}