I have successfully displayed data from one table in one part of my application, but the data won't display in another part. I want to include the Record for the winning team of that year. My View returns nothing when it should return an integer. I am using laravel 5.6.
Controller
$seasonOneWins=gameData::where('homeTeam', '81-North Stars')
->where('homeWin', '1')
->where('year', '2016');
View:
@if($seasonOneWins)
@foreach($seasonOneWins as $seasonOneWin)
<p>{!!$seasonOneWin!!}<p>
@endforeach
@endif
I can't get anything to display in between the foreach's. I assume this means that my formula is suggesting that there is nothing that meets those requirements when I know there is.