cypresslab/angular-ng-routing-bundle
Route::get(), API resources) is fundamentally different from Symfony’s routing, and AngularJS 1.x is largely deprecated in favor of Angular 2+/React/Vue.$resource format, which is useful if your frontend must use AngularJS 1.x. However, Laravel’s API-first approach (e.g., Laravel Sanctum, Passport, or native API routes) typically uses RESTful conventions, not AngularJS-specific resource patterns.FOSJsRoutingBundle), which may introduce compatibility issues or unnecessary bloat.assets:install command, which Laravel replaces with Laravel Mix/Vite. The bundle’s JS assets would need manual integration or rewriting.FOSJsRoutingBundle is also outdated and may have vulnerabilities.Router component.{{ asset() }}).Route::apiResource()) and expose them via:
$resource format via a middleware or service provider.$resource format.FOSJsRoutingBundle with a Laravel-compatible solution (e.g., a middleware that outputs routes as JSON).ng-router.js).{{ asset() }} with Laravel’s asset()).// app/Providers/NgRoutingServiceProvider.php
public function boot()
{
$routes = collect(Route::getRoutes()->getRoutes())->mapWithKeys(function ($route) {
return [$route->getName() => $route->uri()];
});
view()->share('ngRoutingData', $routes->toJson());
}
<!-- resources/views/layouts/app.blade.php -->
<script>
window.NgRouting = {
routes: @json($ngRoutingData),
generateResourceUrl: function(routeName) {
return this.routes[routeName];
}
};
</script>
axios or fetch.FOSJsRoutingBundle may have unresolved issues or vulnerabilities.bundles/ in Laravel’s public/ folder may conflict with Laravel Mix.How can I help you explore Laravel packages today?