UserComposer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A compose() 0 8 1
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