Skip to content

Commit d71fdd3

Browse files
committed
🔖 Updated illuminate ...
1 parent b0c331a commit d71fdd3

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

CHANGELOG.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Leaf Blade v1.2.3 - 7th March, 2020
2-
## Changelog
3-
### Added
2+
3+
## Added
4+
45
- Added Configure Method
56

6-
### Changed
7+
## Changed
8+
79
- Made directory selection optional on Blade init
810

9-
### Removed
10-
- Nothing was removed
11+
## Removed
12+
13+
- Nothing was removed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "leafs/blade",
33
"description": "Leaf PHP Framework adaptation of jenssegers/blade package",
44
"keywords": ["leaf", "leafMVC", "laravel", "blade", "template", "view", "render"],
5-
"homepage": "https://leaf-docs.netlify.com/v2.0/views/blade.html",
65
"license" : "MIT",
76
"type": "library",
87
"authors": [
@@ -15,7 +14,7 @@
1514
],
1615
"require": {
1716
"php": ">=7.0",
18-
"illuminate/view": "^5.5|^6.0"
17+
"illuminate/view": "^5.5|^6.0|^7.0|^8.0"
1918
},
2019
"require-dev": {
2120
"phpunit/phpunit": "^6.0|^7.0",

src/Blade.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@
44

55
use Illuminate\Container\Container;
66
use Illuminate\Contracts\Container\Container as ContainerInterface;
7+
use Illuminate\Contracts\Foundation\Application;
78
use Illuminate\Contracts\View\Factory as FactoryContract;
89
use Illuminate\Contracts\View\View;
910
use Illuminate\Events\Dispatcher;
1011
use Illuminate\Filesystem\Filesystem;
12+
use Illuminate\Support\Facades\Facade;
1113
use Illuminate\View\Compilers\BladeCompiler;
1214
use Illuminate\View\Factory;
1315
use Illuminate\View\ViewServiceProvider;
1416

1517
class Blade implements FactoryContract
1618
{
1719
/**
18-
* @var Container
20+
* @var Application
1921
*/
2022
protected $container;
2123

@@ -34,16 +36,12 @@ public function __construct($viewPaths = null, string $cachePath = null, Contai
3436
$this->container = $container ?: new Container;
3537

3638
if ($viewPaths != null && $cachePath != null) {
37-
$this->setupContainer((array) $viewPaths, $cachePath);
38-
(new ViewServiceProvider($this->container))->register();
39-
40-
$this->factory = $this->container->get('view');
41-
$this->compiler = $this->container->get('blade.compiler');
39+
$this->configure($viewPaths, $cachePath);
4240
}
4341
}
4442

4543
/**
46-
* Configuation for template and cache directories
44+
* Configure your view and cache directories
4745
*/
4846
public function configure($viewPaths, $cachePath)
4947
{
@@ -89,6 +87,11 @@ public function directive(string $name, callable $handler)
8987
$this->compiler->directive($name, $handler);
9088
}
9189

90+
public function if($name, callable $callback)
91+
{
92+
$this->compiler->if($name, $callback);
93+
}
94+
9295
public function exists($view): bool
9396
{
9497
return $this->factory->exists($view);
@@ -149,5 +152,7 @@ protected function setupContainer(array $viewPaths, string $cachePath)
149152
'view.compiled' => $cachePath,
150153
];
151154
}, true);
155+
156+
Facade::setFacadeApplication($this->container);
152157
}
153158
}

0 commit comments

Comments
 (0)