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.

45 lines
965 B

<?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
]);
}
}