Skip to content

Commit

Permalink
Update TalksController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemirpolat authored Feb 9, 2019
1 parent 825fc0b commit 8f28c55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/TalksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function approveAction(Request $request, Talk $talk): RedirectResponse
public function votes($talk)
{
$votes = Vote::with('user')->where('talk_id',$talk->id)->get();
return view('talks.votes')->with('votes',$votes);
return view('talks.votes',['votes' => $votes, 'talk' => $talk->title]);

}
}

1 comment on commit 8f28c55

@emir
Copy link
Owner

@emir emir commented on 8f28c55 Feb 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

['votes' => $votes] olarak göndermek yerine compact('votes') da gönderebiliyorsun. compact() PHP Sapi fonksiyonu. Burada compact('votes', 'talk') gibi gönderebilirsin.

Please sign in to comment.