public function testCurrentSiteScope() { $site = currentSite(); $banner = new Banner(); $banner->name = 'Yes, It is a banner'; $banner->save(); $this->assertEquals($site->id, $banner->site_id); }
public function run() { Eloquent::unguard(); $banner = new Banner(); $banner->id = 1; $banner->name = 'Banner Principal'; $banner->site_id = currentSite()->id; $banner->save(); }
public function register() { $banner = Banner::first(); $listBackground = array('banner_bg1.png', 'banner_bg2.png', 'banner_bg3.png', 'banner_bg4.png'); $getBackgroundByPos = function ($pos) use($listBackground) { return moduleAsset('banner', 'images/' . $listBackground[$pos % count($listBackground)]); }; return View::make('banner::widgets.mainBanner.mainBanner', compact('banner', 'getBackgroundByPos')); }
public function getBanner() { return Banner::first(); }