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);
 }