Skip to content

Commit

Permalink
Fixed regression from #29
Browse files Browse the repository at this point in the history
  • Loading branch information
toonvandenbos committed Jul 26, 2019
1 parent 5707642 commit 1f017f7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/NovaPageServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ public function register()
public function registerBladeDirectives()
{
Blade::directive('get', function ($key) {
$key = trim($key, "'\"");
return resolve(Manager::class)->get($key);
return '<?= Page::get(\'' . trim($key, "'\"") . '\'); ?>';
});

Blade::directive('option', function($key) {
list($name, $attribute) = explode('.', trim($key, "'\""), 2);
$pages = resolve(Manager::class);
return data_get($pages->option($name), $attribute);
return '<?= data_get(Page::option(\'' . $name . '\'),\'' . $attribute . '\'); ?>';
});
}

Expand Down

0 comments on commit 1f017f7

Please sign in to comment.