Skip to content

Commit 7cbf782

Browse files
authored
Merge pull request #19 from lead-worker/fix_factory_for_laravel_5.5
Fix factory for laravel 5.5
2 parents f3068fe + 6df0886 commit 7cbf782

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/View/Factory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function make($view, $data = [], $mergeData = [])
5151
// the caller for rendering or performing other view manipulations on this.
5252
$data = array_merge($mergeData, $this->parseData($data));
5353

54-
return tap($this->viewInstance($view, $path, $data), function ($view) {
54+
return tap(new View($this, $this->getEngineFromPath($path), $view, $path, $data, $this->shortcode), function ($view) {
5555
$this->callCreator($view);
5656
});
5757
}

tests/FactoryTest.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
4+
namespace Webwizo\Shortcodes;
5+
6+
7+
use Webwizo\Shortcodes\View\View;
8+
9+
class FactoryTest extends TestCase
10+
{
11+
12+
public function testMake()
13+
{
14+
$factory = app('view');
15+
16+
$factory->addNamespace('Test', __DIR__.'/views');
17+
18+
$this->assertTrue($factory->make('Test::test') instanceof View);
19+
}
20+
}

tests/views/test.blade.php

Whitespace-only changes.

0 commit comments

Comments
 (0)