UserComposer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Http\ViewComposers;
9
10
use Illuminate\Contracts\View\View;
11
12
class UserComposer
13
{
14
    public function __construct()
15
    {
16
    }
17
18
    /**
19
     * Bind data to the view.
20
     *
21
     * @param View $view
22
     *
23
     * @return void
24
     */
25
    public function compose(View $view)
26
    {
27
        $user = \DB::table('users')
28
            ->leftJoin('user_settings', 'users.id', '=', 'user_settings.user_id')
29
            ->where('users.id', '=', \Auth::id());
30
31
        $view->with('user', $user);
32
    }
33
}
34