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

Localization::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
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