Completed
Push — master ( 8f08c7...7bd638 )
by Mohamed
02:25
created

Localization   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace Microboard\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Http\Request;
7
8
class Localization
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  Request  $request
14
     * @param Closure $next
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {
19
        if (session()->has('locale')) {
20
            app()->setLocale(session()->get('locale'));
21
        }
22
23
        return $next($request);
24
    }
25
}
26