<div class="box-body" style="display: block;"> <div class="table-responsive"> <table class="table no-margin"> <thead> <tr> <th>Name</th> <th>Phone</th> <th>Rating</th> <th>View Rating</th> <th>Address</th> </tr> </thead> <tbody> @foreach($donors as $donor) <?php $ratingUserName = \App\LocalUser::where('user_id', $donor->donorId)->select('username')->first(); ?> <tr> <td><a href='{{url("/donors", [$donor->donorId])}}'>{{$ratingUserName->username}}</a></td> {{--donor phone number--}} <td>{{$donor->phone}}</td> {{--send give rating request--}} <td><a href="http://localhost/cw_rating_api/public/rating/seller={{$ratingUserName->username}}&buyer={{Auth::user()->localUser->username}}&redirect=www.google.com"><span class="label label-danger">Give Rating</span></a></td> {{--view rating request--}} <td><a href="{{url('donors/rating/'.$donor->donorId)}}"><span class="label label-success">View Rating</span></a></td> {{--show donor address--}} <td>{{$donor->address}}</td>
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $school = School::with('image')->with('user')->where('school_id', '=', $id)->first(); $localuser = LocalUser::where('user_id', '=', $school->user->user_id)->first(); return view('listing')->with(array('school' => $school, 'localuser' => $localuser)); }