<?php

namespace App\Http\Controllers;

use App\Models\Universite;
use Illuminate\Http\Request;

use Illuminate\Support\Facades\DB;

class UniversiteController extends Controller
{
    public function index()
    {
        $universites = DB::connection('tenant_2')
        ->table('universite')
        ->get();
        //  dd($universites);

    return view('universites.index', compact('universites'));
    }

    public function show($id)
    {
        $etablissement = DB::connection('tenant_2')
            ->table('universite')
            ->where('idUniversite', $id)
            ->first();

        if (!$etablissement) {
            return abort(404, "université non trouvé.");
        }

        return view('universites.show', compact('universite'));
    }
    
   
    

   
}
