public function postEdit(Post $Page) { $Page->subject = $this->request->get('subject'); $Page->permalink = $this->request->get('permalink'); $Page->content = $this->request->get('content'); $Page->save(); return $this->redirector->route('page.list', ['id' => $Page->id]); }
/** * @param User $User * @param int $title * @param int $content * @param array $tags * @return Post */ public function createPost(User $User, $title, $content, array $tags = []) { $Post = new Post(); $Post->set(Post::FIELD_USER_OWNER, $User); $Post->set(Post::FIELD_TITLE, $title); $Post->set(Post::FIELD_CONTENT, $content); $Post->set(Post::FIELD_TAGS, $tags); $Post->set(Post::FIELD_CREATE_AT, Time::getTime()); $Post->save(); $FeedProvider = $this->getFeedProvider(); $FeedProvider->getFeed(FeedType::MAIN)->savePost($Post); $FeedProvider->getFeed(FeedType::USER)->savePost($Post); $FeedProvider->getFeed(FeedType::TAG)->savePost($Post); return $Post; }
public function putUpdate(Post $ad) { $inputs = $this->request->only('subject', 'permalink', 'content'); $rules = ['subject' => ['required', 'max:200'], 'permalink' => ['max:200'], 'content' => ['']]; $inputs['permalink'] = $this->slug($inputs['permalink']); $validator = Validator::make($inputs, $rules); if ($validator->fails()) { return $this->redirector->back()->withErrors($validator)->withInput($inputs); } $ad->subject = $inputs['subject']; $ad->permalink = $inputs['permalink']; $ad->content = $inputs['content']; $ad->save(); return $this->redirector->route('ad.list'); }
public function putUpdate(Post $tab) { $inputs = Input::only("language", 'subject', 'permalink', 'content'); $rules = ['subject' => ['required', 'max:200'], 'permalink' => ['max:200'], 'content' => ['']]; $inputs['permalink'] = $this->slug($inputs['permalink']); $validator = Validator::make($inputs, $rules); if ($validator->fails()) { return \Redirect::back()->withErrors($validator)->withInput($inputs); } $tab->subject = $inputs['subject']; $tab->permalink = $inputs['permalink']; $tab->content = $inputs['content']; $tab->content = $inputs['language']; $tab->save(); return Redirect::route('tab.list'); }
public function postEdit(Post $post) { $post->subject = $this->request->get('subject'); $post->permalink = $this->request->get('permalink'); $post->content = $this->request->get('content'); $post->featured_image = $this->request->get('featured_image'); $post->gallery_id = $this->request->get('gallery_id'); $post->save(); $cats = explode(',', $this->request->get("post_cats")); $post->cats()->sync($cats); return $this->redirector->route('post.edit', array('id' => $post->id)); }