ToggleSwitchFields::routes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 6
c 2
b 1
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 3
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