我正在使用laravel 5.2。我想获取current_link的ID。请帮我找到current_link的id。
public function checkUrl(){
$current_link = $_SERVER['REQUEST_URI'];
$current_link=ltrim($current_link, '/');
$current_link=ltrim($current_link, 'cable');
$current_link=ltrim($current_link, '/');
$plink = DB::table('roles')->where('id',$current_link->id)->get();
// print_r($plink);
// die();
$dlink= DB::table('my_roles')->where('role_id',$current_link->role_id)->get();
if($plink!=$dlink){
Session::flash('flash_notification', array('level' => 'success', 'message' => 'Error!! You dont have the permission to access this page'));
return Redirect::action('Admin\DashboardController@index');
}
}