Completed
Push — master ( ca46fd...1d0b8e )
by
unknown
19:27 queued 09:34
created

LocaleComposer::compose()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace BBSLab\NovaTranslation\Http\View\Composers;
4
5
use BBSLab\NovaTranslation\NovaTranslation;
6
use Illuminate\View\View;
7
8
class LocaleComposer
9
{
10
    /**
11
     * Bind data to the view.
12
     *
13
     * @param  \Illuminate\View\View  $view
14
     * @return void
15
     * @throws \Exception
16
     */
17
    public function compose(View $view)
18
    {
19
        $view->with([
20
            'locale' => $current = NovaTranslation::currentLocale(),
21
            'locales' => NovaTranslation::otherLocales($current),
22
        ]);
23
    }
24
}
25