Example #1
0
 public function getIndex()
 {
     $tags = TalkTag::orderBy('name')->whereActive(1)->get();
     $categories = TalkCategory::orderBy('name')->whereActive(1)->get();
     $posts = TalkPost::orderBy('created_at', 'DESC')->whereParent_id(0)->take(10)->get();
     $this->layout->content = View::make('talk::home.index')->with('tags', $tags)->with('posts', $posts)->with('categories', $categories);
 }
Example #2
0
 public function getIndex()
 {
     // get available Tags
     $tags = TalkTag::select('id', 'name')->whereActive(1)->lists('name', 'id');
     // get available Categories
     $categories = TalkCategory::select('id', 'name')->whereActive(1)->lists('name', 'id');
     $this->layout->content = View::make('talk::write.index')->with('tags', $tags)->with('categories', $categories);
 }
Example #3
0
 public function destroy($id)
 {
     if (strtoupper(Input::get('delete')) == 'DELETE') {
         $tag = TalkTag::findOrFail($id);
         $tag->delete();
         return Redirect::route(Config::get('talk::routes.base') . '.admin.tags.index');
     }
     return Redirect::route(Config::get('talk::routes.base') . '.admin.tags.show', $id);
 }
Example #4
0
 public function missingMethod($parameters = array())
 {
     $tag = TalkTag::whereSlug($parameters[0])->whereActive(1)->first();
     $posts = null;
     if (null != $tag) {
         $posts = $tag->posts()->whereParent_id(0)->paginate(15);
     }
     $this->layout->content = View::make('talk::tags.list', compact('posts'))->with('tag', $tag);
 }