Completed
Push — master ( a5bfea...791204 )
by Sebastian
04:24
created

BladeDirectiveServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 13
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A boot() 0 6 1
1
<?php
2
3
namespace App\Providers;
4
5
use Blade;
6
use Illuminate\Support\ServiceProvider;
7
8
class BladeDirectiveServiceProvider extends ServiceProvider
9
{
10
    public function register()
11
    {
12
    }
13
14
    public function boot()
15
    {
16
        Blade::directive('json', function($expression) {
17
            return "<?php echo json_encode({$expression}); ?>";
18
        });
19
    }
20
}
21