ToggleSwitchFields   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
eloc 7
c 2
b 1
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A routes() 0 10 1
1
<?php
2
3
namespace SoareCostin\LaravelToggleSwitchFields;
4
5
use Illuminate\Support\Facades\Route;
6
7
class ToggleSwitchFields
8
{
9
    public function routes($uri, $controller, $namePrefix)
10
    {
11
        Route::get($uri.'/{switchable}/on', [
12
            'uses' => $controller.'@switchOn',
13
            'as' => $namePrefix.'.on',
14
        ]);
15
16
        Route::get($uri.'/{switchable}/off', [
17
            'uses' => $controller.'@switchOff',
18
            'as' => $namePrefix.'.off',
19
        ]);
20
    }
21
}
22