Skip to content

Commit

Permalink
consider publish date
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdemirbur committed May 7, 2015
1 parent ab58308 commit 8679698
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function setPublishedAtAttribute($date)
*/
public function setContentAttribute($content)
{
$this->attributes['content'] = clean($content,'youtube');
$this->attributes['content'] = clean($content, 'youtube');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Application/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CategoryController extends Controller {
*/
public function index(Category $category)
{
$articles = $category->articles()->paginate(5);
$articles = $category->articles()->published()->orderBy('published_at','desc')->paginate(5);
return view('application.category.index', compact('articles', 'category'));
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Application/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class HomeController extends Controller {
public function index()
{
$language = Session::get('language', Config::get('app.locale'));
$articles = Language::whereCode($language)->first()->articles()->paginate(5);
$articles = Language::whereCode($language)->first()->articles()->published()->orderBy('published_at','desc')->paginate(5);
return view('application.home.index', compact('articles'));
}

Expand Down

0 comments on commit 8679698

Please sign in to comment.