PHP Snippet 1:
$ignoreRoutes = [
'administrator',
'attachImage',
'login',
'logout',
'loginToPanel',
'attachImage',
'settingsList',
'settingsCreate',
'settingsStore',
'settingsEdit',
'settingsUpdate',
'settingsDestroy',
'usersPermission',
'posts'
];
$tests = ['usersPermission.index','usersPermission.create','xx.create'];
foreach($tests as $test){
$ignore = false;
foreach($ignoreRoutes as $ignoreRoute){
if(strpos($test,$ignoreRoute) === 0) {
$ignore = true;
break;
}
}
if($ignore) echo 'ignore '.$test."<br>\n";
else echo 'not ignore '.$test."<br>\n";
}