Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mossailem committed Nov 7, 2024
1 parent 22c6c35 commit 2ac803d
Showing 1 changed file with 16 additions and 14 deletions.
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);
}
}

0 comments on commit 2ac803d

Please sign in to comment.