Passed
Push — task/laravel-breadcrumbs ( 3beccb...a96280 )
by Yonathan
10:46 queued 10s
created

OneTimePasswordComposer::compose()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 12
rs 9.9666
cc 3
nc 3
nop 1
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use Illuminate\View\View;
6
use Illuminate\Support\Facades\Lang;
7
use Facades\App\Services\WhichPortal;
8
9
class OneTimePasswordComposer
10
{
11
    /**
12
     * Bind data to the view.
13
     *
14
     * @param  View  $view
2 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
15
     * @return void
16
     */
17
    public function compose(View $view)
18
    {
19
        if (WhichPortal::isManagerPortal()) {
20
            $logout_link = route('manager.logout');
21
        } elseif (WhichPortal::isAdminPortal()) {
22
            $logout_link = backpack_url('logout');
23
        } else {
24
            $logout_link = route('logout');
25
        }
26
        $view->with('otp', Lang::get('one_time_password'))
27
            ->with([
28
                'logout_link' => $logout_link,
29
            ]);
30
    }
31
}
32