PublicPagesController   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A impress() 0 3 1
A privacyStatement() 0 7 2
A termsAndConditions() 0 7 2
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Setting;
6
use Illuminate\Support\Facades\App;
7
8
class PublicPagesController extends Controller
9
{
10
    public function impress()
11
    {
12
        return redirect()->away(config('app.impress_url'));
13
    }
14
15
    public function termsAndConditions()
16
    {
17
        $terms = Setting::where('name', 'terms')->where('lang', App::getLocale())->first();
18
        $termsHtml = $terms ? $terms->value : view('components.default-texts.terms')->render();
19
20
        return view('public.terms', [
21
            'terms' => $termsHtml
22
        ]);
23
    }
24
25
    public function privacyStatement()
26
    {
27
        $privacy = Setting::where('name', 'privacy')->where('lang', App::getLocale())->first();
28
        $privHtml = $privacy ? $privacy->value : view('components.default-texts.privacy')->render();
29
30
        return view('public.privacy', [
31
            'privacy' => $privHtml
32
        ]);
33
    }
34
}