我有一个名为simpleController
的控制器,这是代码
use Illuminate\Support\Facades\Redirect;
class simpleController extends Controller {
public function complete() {
$all_registration_info=DB::table('registration')->get();
if (count($all_registration_info) > 0) {
return view('complete',$all_registration_info);
}else{
return view('index');
}
}
}
然后有一个名为complete.blade.php的类,这里是代码
<tbody>
@foreach( $data as $value)
<tr>
<th scope="row">{{$value->id}}</th>
<td>{{$value->name}}</td>
<td>{{$value->email}}</td>
<td>{{$value->phone}}</td>
<td>{{$value->password}}</td>
<td>
<a href="" class="btn btn-info">Edit</a>
<a href="" class="btn btn-danger">Delete</a>
</td>
</tr>
@endforeach
</tbody>