use App\Models\Product;
use App\Models\ProductType;
-use Cubist\Backpack\app\Magic\Menu\Item;
+use Cubist\Backpack\app\Magic\Menu\PageItem;
use Cubist\Backpack\app\Magic\Menu\VirtualItem;
use Cubist\Backpack\app\Template\TemplateAbstract;
use Barryvdh\Debugbar\Facade as Debugbar;
continue;
}
- $category = new Item();
+ $category = new PageItem();
+ $category->initFromEntity($productType);
$category->setTitle($productType->name);
$category->setHref($productType->getSlugOrTitleAttribute());
$category->setId('product_type_' . $productType->id);
if (!$product->online) {
continue;
}
- $detail = new Item();
+ $detail = new PageItem();
+ $category->initFromEntity($product);
$detail->setTitle($product->name);
$detail->setHref($product->getSlugOrTitleAttribute());
$detail->setId('product/' . $product->id);
use App\Models\News as NewsModel;
use Carbon\Carbon;
-use Cubist\Backpack\app\Magic\Menu\Item;
+use Cubist\Backpack\app\Magic\Menu\PageItem;
use Barryvdh\Debugbar\Facade as Debugbar;
class News extends Base
// Todo: see if we should handle events differently? Should events have a different ID + URL and maybe a different controller action in case we need a different layout?
- $item = new Item();
+ $item = new PageItem();
+ $item->initFromEntity($newsItem);
$item->setTitle($newsItem->title);
$item->setHref($newsItem->slug); // Todo: consider having a configurable / translatable prefix for news URLs
$item->setId('news/' . $newsItem->id);
use App\Models\Application;
use Barryvdh\Debugbar\Facade as Debugbar;
-use Cubist\Backpack\app\Magic\Menu\Item;
+use Cubist\Backpack\app\Magic\Menu\PageItem;
use Cubist\Backpack\app\Magic\PageData;
class Solution extends Base
$applications = Application::all();
foreach ($applications as $application) {
- $item = new Item();
+ $item = new PageItem();
+ $item->initFromEntity($application);
$item->setTitle($application->title);
$item->setHref($application->getSlugOrTitleAttribute());
$item->setId('application/' . $application->id);