Ich habe eine Tabellenansicht, in der ich auf ein Schaltflächensymbol klicken und auf eine andere Seite umleiten kann, die die enthält Ausweis der angeklickten Zeile.
@foreach ($patients as $patient)
<tr>
<td>{{ $patient->pID }}</td>
<td>{{ $patient->pName }}</td>
<td>{{ $patient->pAddress }}</td>
<td>{{ $patient->pBday }}</td>
<td>{{ $patient->pPhone}}</td>
<td>{{ $patient->pEcon }}</td>
<td>{{ $patient->pDreg }}</td>
<td></td>
<td>
<a href="https://stackoverflow.com/questions/33266316/{{ URL::to("visit/'.$patient->pID) }}">
<img src="../images/viewvisit.png" style="width:30px; height:30px;">
</a>
</td>
<td>
<a href="https://stackoverflow.com/questions/33266316/{{ URL::to("addeditvisit/'.$patient->pID) }}">
<img src="../images/visit.png" style="width:30px; height:30px;">
</a>
</td>
<td>
<a href="https://stackoverflow.com/questions/33266316/{{ URL::to("editpatient/'.$patient->pID) }}">
<img src="../images/update.png" style="width:30px; height:30px;">
</a>
</td>
<td>
<a href="https://stackoverflow.com/questions/33266316/{{ URL::to("deletepatient/'.$patient->pID) }}">
<img src="../images/delete.png" style="width:30px; height:30px;">
</a>
</td>
</tr>
@endforeach
Was ich will, ist das zu bekommen Ausweis aus der URL und füge sie in eine Variable ein, damit ich sie auf meiner anderen Seite verwenden kann.
Ich stecke derzeit mit dieser Controller-Funktion fest.
public function index(Request $request) {
$doctors = Doctor::where('dStatus', 0)
->lists('dName', 'dID');
$beds = Bed::where('bStatus', 0)
->lists('bName', 'bID');
$patient = Patient::patient();
// $uri = $request->path('patient');
return View::make('pages.addeditvisit', [
'doctors'=>$doctors,
'beds'=>$beds,
'patient'=>$patient->pID
]);
}
Wie haben Sie Ihre Routen definiert?
– Akshendra Pratap
21. Oktober 2015 um 18:13 Uhr