Completed
Pull Request — master (#14)
by
unknown
04:32
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
     * Get the evaluated view contents for the given component.
12
     *
13
     * @param  string  $component
14
     * @param  array   $data
15
     * @return \Illuminate\Contracts\Support\Renderable
16
     */
17
    public function make($component, $data = [])
18
    {
19
        return new ComponentView(app($component, $data));
20
    }
21
}
22