Passed
Push — master ( c14ede...c50061 )
by Ferry
03:59
created

DeveloperMailController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: User
5
 * Date: 4/25/2019
6
 * Time: 9:28 PM
7
 */
8
9
namespace crocodicstudio\crudbooster\controllers;
10
11
12
use crocodicstudio\crudbooster\exceptions\CBValidationException;
13
use Doctrine\DBAL\Query\QueryException;
14
use Illuminate\Support\Facades\DB;
15
16
class DeveloperMailController extends Controller
17
{
18
    private $view = "crudbooster::dev_layouts.modules.mail";
19
20
    public function __construct()
21
    {
22
        view()->share(['page_title'=>'Mail Configuration']);
23
    }
24
25
    public function getIndex() {
26
        $data = [];
27
        return view($this->view.".index",$data);
28
    }
29
30
    public function postSave()
31
    {
32
        setEnvironmentValue([
33
            "MAIL_DRIVER"=>request("MAIL_DRIVER"),
34
            "MAIL_HOST"=>request("MAIL_HOST"),
35
            "MAIL_PORT"=>request("MAIL_PORT"),
36
            "MAIL_USERNAME"=>request("MAIL_USERNAME"),
37
            "MAIL_PASSWORD"=>request("MAIL_PASSWORD"),
38
            "MAIL_ENCRYPTION"=>request("MAIL_ENCRYPTION")
39
        ]);
40
41
        return cb()->redirectBack("Mail configuration has been updated!","success");
42
    }
43
}