My beer compendium
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.

27 lines
552 B

3 years ago
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Models\Brewerie;
  5. use App\Models\Summarie;
  6. class BreweryController extends Controller
  7. {
  8. public function __construct()
  9. {
  10. $this->middleware('auth');
  11. }
  12. public function index($breweryID)
  13. {
  14. $breweries = Brewerie::where('id', (int)$breweryID)->get();
  15. $beers = Summarie::where('brewery_id', $breweryID)->get();
  16. $data = array('breweries'=>$breweries, 'beers'=>$beers);
  17. return view('brewery', compact('breweries', 'beers'));
  18. }
  19. }