WebTinkerController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 4 1
A execute() 0 7 1
1
<?php
2
3
namespace Spatie\WebTinker\Http\Controllers;
4
5
use Illuminate\Contracts\Routing\UrlGenerator;
6
use Illuminate\Http\Request;
7
use Spatie\WebTinker\Tinker;
8
9
class WebTinkerController
10
{
11
    public function index()
12
    {
13
        return view('web-tinker::web-tinker', [
14
            'path' => app(UrlGenerator::class)->to(config('web-tinker.path')),
15
        ]);
16
    }
17
18
    public function execute(Request $request, Tinker $tinker)
19
    {
20
        $validated = $request->validate([
21
            'code' => 'required',
22
        ]);
23
24
        return $tinker->execute($validated['code']);
25
    }
26
}
27