Skip to content

Commit

Permalink
Merge pull request #602 from zachweix/patch-1
Browse files Browse the repository at this point in the history
Bug Fix
  • Loading branch information
pxpm authored May 27, 2024
2 parents 3da386a + 2753c60 commit 0bc71bc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$userCount = App\User::count();
$articleCount = \Backpack\NewsCRUD\app\Models\Article::count();
$lastArticle = \Backpack\NewsCRUD\app\Models\Article::orderBy('date', 'DESC')->first();
$lastArticleDaysAgo = \Carbon\Carbon::parse($lastArticle->date)->diffInDays(\Carbon\Carbon::today());
$lastArticleDaysAgo = $lastArticle !== null ? \Carbon\Carbon::parse($lastArticle->date)->diffInDays(\Carbon\Carbon::today()).' days' : 'No articles';
// notice we use Widget::add() to add widgets to a certain group
Widget::add()->to('before_content')->type('div')->class('row mt-3')->content([
Expand Down

0 comments on commit 0bc71bc

Please sign in to comment.