I have a table with data showed from the MySQL database.
Here is my controller:
function getData() {
$data['data'] = DB::table('act_hi_procinst')->get();
if(count($data) > 0) {
return view('datatracking', $data);
} else {
return view('datatracking');
}
}
Here is my view:
@foreach($data as $data)
<tr>
<td><a href= "{{ url('/') }}"> {{ $data -> ID_ }}</a></td>
<td>{{ $data -> PROC_INST_ID_ }}</td>
<td>{{ $data -> BUSINESS_KEY_ }}</td>
<td>{{ $data -> PROC_DEF_ID_ }}</td>
<td>{{ $data -> START_TIME_ }}</td>
<td>{{ $data -> END_TIME_ }}</td>
<td>{{ $data -> DURATION_ }}</td>
<td>{{ $data -> START_USER_ID_ }}</td>
<td>{{ $data -> START_ACT_ID_ }}</td>
<td>{{ $data -> END_ACT_ID_ }}</td>
<td>{{ $data -> SUPER_PROCESS_INSTANCE_ID_ }}</td>
<td>{{ $data -> DELETE_REASON_ }}</td>
<td>{{ $data -> TENANT_ID_ }}</td>
<td>{{ $data -> NAME_ }}</td>
</tr>
@endforeach
I use href
tag to make my first column into a link. I want when I click it, it will go to other page and passing the ID_ value
to that page.
I have no idea how to write it in Laravel.