Passed
Push — master ( b69528...d2ddcd )
by Reza
03:53
created

Checkbox::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 7
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 12
rs 10
1
<?php
2
3
namespace EasyPanel\Parsers\HTMLInputs;
4
5
class Checkbox
6
{
7
8
    public function handle($name)
9
    {
10
        $mode = config('easy_panel.lazy_mode') ? 'wire:model.lazy' : 'wire:model';
11
        $UName = ucfirst($name);
12
        return "
13
            <!-- $UName Input -->
14
            <div class='form-group'>
15
                <div class='form-check mt-4 mb-3'>
16
                    <input $mode='$name' class='form-check-input' type='checkbox' id='input$name'>
17
                    <label class='form-check-label' for='input$name'>{{ __('$UName') }}</label>
18
                </div>
19
                @error('$name') <div class='invalid-feedback'>{{ " . '$message' . " }}</div> @enderror
20
            </div>
21
            ";
22
    }
23
}
24