Below is what shows when I dd($role) I get this... (which are the correct roles that have access to the page.
See additional dd below.
Collection {#168 ▼
#items: array:2 [▼
0 => Role {#154 ▼
#connection: null
#table: null
#primaryKey: "id"
#perPage: 15
+incrementing: true
+timestamps: true
#attributes: array:6 [▶]
#original: array:8 [▼
"id" => 4
"name" => "owner"
"label" => "Site Owner"
"created_at" => "2015-09-14 13:51:45"
"updated_at" => "2015-09-14 13:51:45"
"deleted_at" => null
"pivot_permission_id" => 1
"pivot_role_id" => 4
]
#relations: array:1 [▶]
#hidden: []
#visible: []
#appends: []
#fillable: []
#guarded: array:1 [▶]
#dates: []
#dateFormat: null
#casts: []
#touches: []
#observables: []
#with: []
#morphClass: null
+exists: true
+wasRecentlyCreated: false
}
1 => Role {#161 ▼
#connection: null
#table: null
#primaryKey: "id"
#perPage: 15
+incrementing: true
+timestamps: true
#attributes: array:6 [▶]
#original: array:8 [▼
"id" => 5
"name" => "webmaster"
"label" => "Webmaster"
"created_at" => "2015-09-14 13:51:45"
"updated_at" => "2015-09-14 13:51:45"
"deleted_at" => null
"pivot_permission_id" => 1
"pivot_role_id" => 5
]
#relations: array:1 [▶]
#hidden: []
#visible: []
#appends: []
#fillable: []
#guarded: array:1 [▶]
#dates: []
#dateFormat: null
#casts: []
#touches: []
#observables: []
#with: []
#morphClass: null
+exists: true
+wasRecentlyCreated: false
}
]
}
If I dd($this->role) this is what I get... (not sure how this happened.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'roles.user_id' in 'where clause' (SQL: select * from `roles` where `roles`.`user_id` = 3 and `roles`.`user_id` is not null limit 1)