added marking to admin booking index

hide roles in user model
hide user from booking model
This commit is contained in:
Jack Goh
2018-07-07 12:12:27 +08:00
parent 59fc234ea0
commit 71e11fa034
3 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -7,7 +7,8 @@ use Illuminate\Database\Eloquent\Model;
class Booking extends Model
{
// protected $guarded = [];
protected $hidden = array("user_id",
protected $hidden = array( "user",
"user_id",
"rate_id",
"rmb_book_amount",
"rmb_book_pay_method",
+3 -2
View File
@@ -76,7 +76,7 @@ class BookingController extends Controller
public function adminIndex(){
$user = Auth::user();
$bookings = Booking::select('id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
$bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
->orderby('updated_at','desc')
->get();
@@ -125,7 +125,8 @@ class BookingController extends Controller
break;
default:
$status_desc = "";
}
}
$booking->marking = $booking->user->marking;
$booking->status_desc = $status_desc;
}
return $bookings;
+1 -1
View File
@@ -29,7 +29,7 @@ class User extends Authenticatable implements JWTSubject
* @var array
*/
protected $hidden = [
'password', 'remember_token',
'password', 'remember_token', 'roles'
];
/**