Пример #1
0
 public function boot()
 {
     parent::boot();
     Models\Asset::observe(CreationLogObserver::class);
     Models\AssetVersion::observe(CreationLogObserver::class);
     Models\Page::observe(CreationLogObserver::class);
     Models\PageVersion::observe(CreationLogObserver::class);
     Models\Asset::observe(SetSiteObserver::class);
     Models\Group::observe(SetSiteObserver::class);
     Models\Page::observe(SetSiteObserver::class);
     Models\Tag::observe(SetSiteObserver::class);
     Models\URL::observe(SetSiteObserver::class);
     Models\Page::observe(DeletionLogObserver::class);
 }
Пример #2
0
 public function testNameIsTrimmed()
 {
     $group = new Group();
     $group->setName(' test ');
     $this->assertEquals('test', $group->getName());
 }
Пример #3
0
 public function store(Request $request, GroupModel $group)
 {
     $group->addRole($request->input('role_id'), $request->input('allowed'), $request->input('page_id'));
 }
Пример #4
0
 /**
  * @param SiteInterface $site
  *
  * @return Collection
  */
 public function findBySite(SiteModelInterface $site)
 {
     return $this->model->where(Model::ATTR_SITE, '=', $site->getId())->orderBy(Model::ATTR_NAME, 'asc')->get();
 }
Пример #5
0
 public function find($id)
 {
     return $this->model->find($id);
 }
Пример #6
0
 public function update(Request $request, GroupModel $group)
 {
     $group->setName($request->input('name'));
     GroupFacade::save($group);
 }