From 3dd1bb5af9c6bba7d1b0a0e15c5c690fd26d1c54 Mon Sep 17 00:00:00 2001 From: Rajendra Sharma Date: Wed, 19 Dec 2018 17:51:56 +0700 Subject: [PATCH] patch issue --- src/ContentManager/ContentGenerator.php | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/ContentManager/ContentGenerator.php b/src/ContentManager/ContentGenerator.php index 1ffd09f..461560e 100644 --- a/src/ContentManager/ContentGenerator.php +++ b/src/ContentManager/ContentGenerator.php @@ -67,14 +67,14 @@ public function formatContent($array, $indexed = true) public function getDeleteStatement($dataType): string { $delete = <<<'TXT' -\$dataType = DataType::find('10'); +$dataType = DataType::find('10'); - if (is_bread_translatable(\$dataType)) { - \$dataType->deleteAttributeTranslations(\$dataType->getTranslatableAttributes()); + if (is_bread_translatable($dataType)) { + $dataType->deleteAttributeTranslations($dataType->getTranslatableAttributes()); } - if (\$dataType) { - \$dataType->destroy(10); + if ($dataType) { + $dataType->destroy(10); } TXT; @@ -90,10 +90,10 @@ public function getDeleteStatement($dataType): string public function generateMenuDeleteStatements($dataType) : string { $menuDelete = <<<'TXT' -\$menuItem = MenuItem::where('route', 'voyager.\$dataType->slug.index'); +$menuItem = MenuItem::where('route', 'voyager.$dataType->slug.index'); - if (\$menuItem->exists()) { - \$menuItem->delete(); + if ($menuItem->exists()) { + $menuItem->delete(); } TXT; @@ -111,12 +111,12 @@ public function generateMenuDeleteStatements($dataType) : string public function getPermissionStatement($dataType, $type = null) : string { $permission = <<<'TXT' -Voyager::model('Permission')->generateFor(\$dataType->name); +Voyager::model('Permission')->generateFor($dataType->name); TXT; if (! is_null($type)) { $permission = <<<'TXT' -Voyager::model('Permission')->removeFrom(\$dataType->name); +Voyager::model('Permission')->removeFrom($dataType->name); TXT; } @@ -132,24 +132,24 @@ public function getPermissionStatement($dataType, $type = null) : string public function getMenuInsertStatements($dataType) : string { $menu = <<<'TXT' -\$menu = Menu::where('name', config('voyager.bread.default_menu'))->firstOrFail(); +$menu = Menu::where('name', config('voyager.bread.default_menu'))->firstOrFail(); - \$menuItem = MenuItem::firstOrNew([ - 'menu_id' => \$menu->id, + $menuItem = MenuItem::firstOrNew([ + 'menu_id' => $menu->id, 'title' => 'Credit Cards', 'url' => '', 'route' => 'voyager.credit-cards.index', ]); - \$order = Voyager::model('MenuItem')->highestOrderMenuItem(); + $order = Voyager::model('MenuItem')->highestOrderMenuItem(); - if (!\$menuItem->exists) { - \$menuItem->fill([ + if (!$menuItem->exists) { + $menuItem->fill([ 'target' => '_self', 'icon_class' => '', 'color' => null, 'parent_id' => null, - 'order' => \$order, + 'order' => $order, ])->save(); } TXT;