示例#1
1
 /**
  * @param $topicId
  * @param $input
  */
 public function edit($topicId, $input)
 {
     // Edit topic's title
     $data = ['title' => $input['title']];
     // Edit topic's tag
     if (\Bouncer::hasPermission('forums.tag') and \Input::get('tag')) {
         $data['tag'] = \Input::get('tag');
     }
     // Edit topic
     $this->topicRepo->updateTopic($topicId, $data);
 }
示例#2
0
 /**
  * Return if no access
  *
  * @param $permission
  * @param $entity
  * @return bool
  */
 protected function noAccess($permission, $entity)
 {
     if (\Bouncer::hasPermission($permission)) {
         return false;
     }
     return $this->noAccessReturn($entity);
 }
示例#3
0
 /**
  * Create post
  *
  * @param array $input
  * @param                $topic
  * @param                $user
  * @param bool $add
  * @return \Illuminate\Http\RedirectResponse|object
  */
 public function create($input, $topic, $user, $add = true)
 {
     // Create post
     $data = ['markdown' => $input['content'], 'html' => \Purifier::clean(\Markdown::text($input['content'])), 'topic_id' => $topic->id, 'user_id' => $user->id];
     if (\Bouncer::hasPermission('devresponse') and \Input::get('devresponse') == 1) {
         $data['developer_response'] = true;
     }
     $post = $this->postRepo->create($data);
     return $post;
 }