Completed
Pull Request — master (#14)
by
unknown
01:13
created

ComponentFactory::make()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Spatie\ViewComponents;
4
5
use Illuminate\View\Concerns\ManagesComponents;
6
7
final class ComponentFactory
8
{
9
    use ManagesComponents;
10
11
    /**
12
     * Get the evaluated view contents for the given component.
13
     *
14
     * @param  string  $component
15
     * @param  array   $data
16
     * @return \Illuminate\Contracts\Support\Renderable
17
     */
18
    public function make($component, $data = [])
19
    {
20
        return new ComponentView(app($component, $data));
21
    }
22
}
23