Skip to content

Commit

Permalink
Add RedirectResponse type for render() on BanhammerException.
Browse files Browse the repository at this point in the history
When using the ban.fallback_url the response is a RedirectResponse but the method return type only accepts Response.
  • Loading branch information
dannydinges committed Aug 23, 2024
1 parent 502036c commit b376d3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Exceptions/BanhammerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Mchev\Banhammer\Exceptions;

use Exception;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Log;
Expand All @@ -26,7 +27,7 @@ public function report(): void
/**
* Render the exception into an HTTP response.
*/
public function render(Request $request): Response
public function render(Request $request): Response|RedirectResponse
{
return (config('ban.fallback_url'))
? redirect(config('ban.fallback_url'))
Expand Down

0 comments on commit b376d3e

Please sign in to comment.