Files
merchbay/app/Exceptions/Handler.php
Frank John Begornia ad8d8d7564
All checks were successful
Deploy Production (merchbay.com) / deploy (push) Successful in 2m54s
feat: Add MinIO storage support and update image URLs
- Implemented MinIO storage driver in AppServiceProvider for S3-compatible storage.
- Added helper functions to generate MinIO URLs for files and images.
- Updated filesystem configuration to include MinIO settings.
- Modified site configuration to include MinIO URL.
- Enhanced Docker Compose configuration for local development with MinIO.
- Updated various Blade templates to use MinIO URLs for images instead of local paths.
- Ensured all image references in views are now pointing to MinIO storage.
2026-05-13 00:25:23 +08:00

62 lines
1.5 KiB
PHP
Executable File

<?php
namespace App\Exceptions;
use Exception;
use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Throwable $e
* @return void
*/
public function report(Throwable $e)
{
// Laravel 5.0 parent expects an Exception; wrap Error instances so
// PHP 7+ fatal errors (TypeError, ParseError, etc.) are handled safely.
if (!$e instanceof Exception) {
$e = new \RuntimeException($e->getMessage(), $e->getCode());
}
return parent::report($e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
// public function render($request, Exception $e)
// {
// return parent::render($request, $e);
// }
public function render($request, Throwable $e)
{
if ($e instanceof MethodNotAllowedHttpException) {
abort(404);
}
// Wrap non-Exception Throwables for Laravel 5.0 parent compatibility.
$exception = $e instanceof Exception ? $e : new \RuntimeException($e->getMessage(), $e->getCode());
return parent::render($request, $exception);
}
}