Пример #1
0
 public function testCurrentSiteScope()
 {
     $site = currentSite();
     $banner = new Banner();
     $banner->name = 'Yes, It is a banner';
     $banner->save();
     $this->assertEquals($site->id, $banner->site_id);
 }
Пример #2
0
 public function run()
 {
     Eloquent::unguard();
     $banner = new Banner();
     $banner->id = 1;
     $banner->name = 'Banner Principal';
     $banner->site_id = currentSite()->id;
     $banner->save();
 }
Пример #3
0
 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'));
 }
Пример #4
0
 public function getBanner()
 {
     return Banner::first();
 }