Beispiel #1
0
 /**
  * Update request rules.
  *
  * @param  array  $rules
  *
  * @return array
  */
 private function updateRules(array $rules)
 {
     $rules['category'] .= '|in:' . implode(',', array_keys(Category::getSelectOptions(false)));
     $rules['tags'] .= '|in:' . implode(',', array_keys(Tag::getSelectOptions()));
     $rules['status'] .= '|in:' . implode(',', PostStatus::keys());
     return $rules;
 }
Beispiel #2
0
 /**
  * Edit a post.
  *
  * @param  \Arcanesoft\Blog\Models\Post  $post
  *
  * @return \Illuminate\View\View
  */
 public function edit(Post $post)
 {
     $this->authorize('blog.posts.update');
     $title = 'Blog - Posts';
     $this->setTitle($title);
     $this->addBreadcrumb('Edit post');
     $categories = Category::getSelectOptions();
     $tags = Tag::getSelectOptions();
     $statuses = PostStatus::all();
     return $this->view('foundation.posts.edit', compact('post', 'categories', 'tags', 'statuses'));
 }