c975l/exceptionchecker-bundle
kernel.exception), making it modular but dependent on Symfony’s event system. Laravel’s exception handling (via middleware/handlers) would require abstraction or middleware emulation.RouteServiceProvider, API gateways). Potential overlap with Laravel’s abort() or redirect() helpers.ExceptionListener with Laravel’s exception middleware (app/Exceptions/Handler.php) or global middleware (Kernel.php).MonologBundle with Laravel’s built-in logging or a package like spatie/laravel-logging.GoneHttpException maps to Laravel’s Symfony\Component\HttpKernel\Exception\GoneHttpException (if using Symfony’s HTTP components), but native Laravel uses Symfony\Component\HttpKernel\Exception\NotFoundHttpException by default.ExceptionChecker model, migrations).Symfony\Component\Form) would need replacement with Laravel’s Form Requests or a package like laravelcollective/html.EventDispatcher, SecurityBundle for auth) would require refactoring or polyfills.Route::fallback()) might interfere with dynamic URL checks. Could require custom route middleware.spatie/laravel-url-redirector) a better fit?php artisan route:cache)? Will dynamic URL checks bypass caching?Log facade or spatie/laravel-logging.| Symfony Component | Laravel Equivalent |
|---|---|
EventDispatcher |
Middleware (HandleExceptions) |
MonologBundle |
Log::channel() or spatie/log |
SecurityBundle |
Laravel Auth (Sanctum/Passport) |
| Doctrine ORM | Eloquent Models |
| Symfony Forms | Form Requests or Livewire/Inertia |
app/Http/Middleware/CheckBrokenUrls.php) that:
Str::is() with * support).HttpResponse::gone() or redirects via abort(410)/redirect().// Example model: app/Models/ExceptionChecker.php
class ExceptionChecker extends Model {
protected $fillable = ['pattern', 'replacement_url', 'is_active'];
// Add wildcard regex logic in accessors/mutators.
}
Route::get('/broken-urls/create', [BrokenUrlController::class, 'create']);
Route::post('/broken-urls', [BrokenUrlController::class, 'store']);
if (auth()->check() || $request->hasValidSecret()) {
// Allow edit/delete.
}
Notifiable interface) or a custom mailable.ExceptionChecker model:
public function matches($url) {
return preg_match($this->patternToRegex($this->pattern), $url);
}
private function patternToRegex($pattern) {
return str_replace('*', '.*', preg_quote($pattern, '/'));
}
GoneHttpException → Laravel’s abort(410).RedirectResponse → Laravel’s redirect()->to().$normalizedUrl = strtolower(parse_url($url, PHP_URL_PATH));
/old-routes/*) before applying globally.ExceptionChecker data before enabling the middleware.config() or environment variables to toggle functionality:
if (config('broken_urls.enabled')) {
// Apply middleware.
}
logs/laravel.log for debugging.Log::info('Redirected broken URL', ['from' => $request->url(), 'to' => $replacement]);
DB::enableQueryLog()) can track changes.ExceptionChecker queries.php artisan optimize:clear after bulk updates to the model.?, +).dd($request->url(), $exceptionChecker->matches($request->url())) for pattern testing.dd() or Xdebug for middleware flow analysis.How can I help you explore Laravel packages today?