Skip to content

Commit

Permalink
fix activity log and order in front page
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 24, 2023
1 parent 67a951a commit ebff058
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class HomeController extends Controller
{
public function index()
{
$articles = Article::latest()->take(3)->get();

return Inertia::render('Public/Home', [
'projects_count' => Project::query()
->whereIsOpen()
Expand All @@ -30,22 +28,23 @@ public function index()

'projects' => ProjectCardResource::collection(
Project::whereIsOpen()
->inRandomOrder()
->latest()
->limit(12)
->get()
),

'bcr_projects' => BCRProjectCardResource::collection(
BCRProject::query()
->latest()
->with('county')
->limit(12)
->get()
),

'articles' => ArticleCardResource::collection(
Article::query()
->latest()
->wherePublished()
->inRandomOrder()
->limit(3)
->get()
),
Expand Down
1 change: 1 addition & 0 deletions app/Models/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public function approve(): void
$media = Media::find($value);
$this->subject->media->add($media);
}
$this->subject->save();
} else {
$this->subject->save();
}
Expand Down

0 comments on commit ebff058

Please sign in to comment.