CreatePage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A render() 0 3 1
1
<?php
2
3
namespace Pratiksh\Adminetic\View\Components;
4
5
use Illuminate\Support\Str;
6
use Illuminate\View\Component;
7
8
class CreatePage extends Component
9
{
10
    public $name;
11
12
    public $route;
13
14
    public $formclass;
15
16
    public $formid;
17
18
    /**
19
     * Create a new component instance.
20
     *
21
     * @return void
22
     */
23
    public function __construct($name, $route, $formclass = null, $formid = null)
24
    {
25
        $this->name = Str::ucfirst($name);
26
        $this->route = $route ?? Str::plural(str_replace(' ', '_', $name));
27
        $this->formclass = $formclass;
28
        $this->formid = $formid;
29
    }
30
31
    /**
32
     * Get the view / contents that represent the component.
33
     *
34
     * @return \Illuminate\Contracts\View\View|\Closure|string
35
     */
36
    public function render()
37
    {
38
        return view('adminetic::components.create-page');
39
    }
40
}
41