Skip to content

Commit

Permalink
updated (#13260)
Browse files Browse the repository at this point in the history
  • Loading branch information
ytake authored and taylorotwell committed Apr 22, 2016
1 parent f4c56c8 commit 532c9f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/View/Compilers/BladeCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ protected function compileForelse($expression)
*/
protected function compileCan($expression)
{
return "<?php if (Gate::check{$expression}): ?>";
return "<?php if (app('Illuminate\\Contracts\\Auth\\Access\\Gate')->check{$expression}): ?>";
}

/**
Expand All @@ -558,7 +558,7 @@ protected function compileCan($expression)
*/
protected function compileCannot($expression)
{
return "<?php if (Gate::denies{$expression}): ?>";
return "<?php if (app('Illuminate\\Contracts\\Auth\\Access\\Gate')->denies{$expression}): ?>";
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/View/ViewBladeCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function testCanStatementsAreCompiled()
$string = '@can (\'update\', [$post])
breeze
@endcan';
$expected = '<?php if (Gate::check(\'update\', [$post])): ?>
$expected = '<?php if (app(\'Illuminate\\Contracts\\Auth\\Access\\Gate\')->check(\'update\', [$post])): ?>
breeze
<?php endif; ?>';
$this->assertEquals($expected, $compiler->compileString($string));
Expand All @@ -244,7 +244,7 @@ public function testCannotStatementsAreCompiled()
$string = '@cannot (\'update\', [$post])
breeze
@endcannot';
$expected = '<?php if (Gate::denies(\'update\', [$post])): ?>
$expected = '<?php if (app(\'Illuminate\\Contracts\\Auth\\Access\\Gate\')->denies(\'update\', [$post])): ?>
breeze
<?php endif; ?>';
$this->assertEquals($expected, $compiler->compileString($string));
Expand Down

0 comments on commit 532c9f8

Please sign in to comment.