예제 #1
0
 public function store()
 {
     $datas = Input::all();
     $post = new Post();
     $post->content = $datas['content'];
     $post->user_id = Session::get('user')['id'];
     $post->privacy = $datas['privacy'];
     $post->save();
     FEEntriesHelper::save($post->id, FEEntriesHelper::getId("Post"), $post->user_id, $post->privacy);
     return Redirect::back()->with('message', 'Đăng thành công!');
 }
예제 #2
0
 public function update($id)
 {
     $blog = Blog::find($id);
     if (FEUsersHelper::isCurrentUser($blog->user->id)) {
         $blog->title = Input::get('title');
         $blog->content = Input::get('content');
         $blog->privacy = Input::get('privacy');
         $blog->save();
         FEEntriesHelper::updatePrivacy($blog->id, 2, $blog->privacy);
         return Redirect::back();
     } else {
         return Redirect::to('/');
     }
 }
예제 #3
0
 public function update($id)
 {
     $album = Album::find($id);
     if (FEUsersHelper::isCurrentUser($album->id)) {
         $album->title = Input::get('title');
         $album->privacy = Input::get('privacy');
         $album->save();
         FEEntriesHelper::updatePrivacy($album->id, 2, Input::get('privacy'));
     }
     return Redirect::back();
 }