|
|
- <?php
- namespace App\Http\Controllers;
-
- use Illuminate\Http\Request;
- use DB;
- use App\Tweet, App\Team, App\Mission;
-
- class ShowTweetsController extends Controller
- {
-
- public function mission(Mission $mission) {
- $tweets = Tweet::where('mission_id', $mission->id)
- ->where('processed', 1)
- ->where('accepted', 1)
- ->orderBy('tweet_date', 'desc')->get();
-
- return view('mission-tweets', [
- 'mission' => $mission,
- 'tweets' => $tweets
- ]);
- }
-
- public function team(Team $team) {
- $tweets = Tweet::where('team_id', $team->id)
- ->where('processed', 1)
- ->where('accepted', 1)
- ->orderBy('tweet_date', 'desc')->get();
-
- return view('team-tweets', [
- 'team' => $team,
- 'tweets' => $tweets
- ]);
- }
-
- public function all() {
- $tweets = Tweet::where('mission_id', 0)
- ->orderBy('tweet_date', 'desc')
- ->get();
-
- return view('all-tweets', [
- 'tweets' => $tweets
- ]);
- }
-
- }
|