You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
764 B

  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use DB;
  5. use App\Tweet, App\Team, App\Mission;
  6. class ShowTweetsController extends Controller
  7. {
  8. public function mission(Mission $mission) {
  9. $tweets = Tweet::where('mission_id', $mission->id)
  10. ->where('processed', 1)
  11. ->where('accepted', 1)
  12. ->orderBy('tweet_date', 'desc')->get();
  13. return view('mission-tweets', [
  14. 'mission' => $mission,
  15. 'tweets' => $tweets
  16. ]);
  17. }
  18. public function team(Team $team) {
  19. $tweets = Tweet::where('team_id', $team->id)
  20. ->where('processed', 1)
  21. ->where('accepted', 1)
  22. ->orderBy('tweet_date', 'desc')->get();
  23. return view('team-tweets', [
  24. 'team' => $team,
  25. 'tweets' => $tweets
  26. ]);
  27. }
  28. }