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); }
public function testNameIsTrimmed() { $group = new Group(); $group->setName(' test '); $this->assertEquals('test', $group->getName()); }
public function store(Request $request, GroupModel $group) { $group->addRole($request->input('role_id'), $request->input('allowed'), $request->input('page_id')); }
/** * @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(); }
public function find($id) { return $this->model->find($id); }
public function update(Request $request, GroupModel $group) { $group->setName($request->input('name')); GroupFacade::save($group); }