I'm trying to retrieve data from my database and send them to my view to visualize them in a datatable.
When I first refreshed the page, I could see the result showing my view but then I'm getting this problem:
This page does not work This request can not be processed via localhost at this time and HTTP ERROR 500
Here's my controller code :
public function index()
{
$Commandes = DB::connection('sqlsrv2')->table('Commande_nadine')
->get();
return view('detailsCommandes',compact('Commandes'));
}
My HTML Code :
<thead>
<tr>
<th>ID Commande</th>
<th>Date Commande</th>
<th>Numéro de commission</th>
<th>Année</th>
<th>Marque</th>
<th>Modèle</th>
<th>Finition</th>
<th>Reférence LC</th>
</tr>
</thead>
<tbody>
@foreach($Commandes as $Commande)
<tr>
<td>{{$Commande->RECID_NADIN}}</td>
<td>{{$Commande->DATE_DOCUMENT_CMD_ACHAT_FRS}}</td>
<td>{{$Commande->Num_Commission_NADIN}}</td>
<td>{{$Commande->Annee}}</td>
<td>{{$Commande->CodeMarque}}</td>
<td>{{$Commande->CodeModele}}</td>
<td>{{$Commande->CodeFinition}}</td>
<td>{{$Commande->REF_LC_BANQUE}}</td>
</tr>
@endforeach
</tbody>
and here's my route :
Route::get('/detailsCommandes', 'CommandeNadineController@index')->name('details');
Can you tell me what's not working here?