Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions src/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,20 @@ public static function isReady(): bool
return $result;
}

/**
* Check whether the current route is exluded or not.
*
* @return bool
*/
public static function routeIsNotExluded(): bool
{
$routes = explode(',', env('VITE_EXCLUDED_ROUTES'));

# remove spaces before and after the route.
// foreach($routes as $i => $route) $routes[$i] = ltrim( rtrim($route) );

return !in_array(uri_string(), $routes);
}
/**
* Check whether the current route is exluded or not.
*
* @return bool
*/
public static function routeIsNotExluded(): bool
{
$routes = explode(',', env('VITE_EXCLUDED_ROUTES'));

# remove spaces before and after the route.
// foreach($routes as $i => $route) $routes[$i] = ltrim( rtrim($route) );

$routes = array_filter($routes, function ($route) { return $route !== ""; });

return !in_array(uri_string(), $routes);
}
}