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

DeveloperMailController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A postSave() 0 12 1
A getIndex() 0 3 1
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
}