Skip to content

Commit

Permalink
Add Validation
Browse files Browse the repository at this point in the history
  • Loading branch information
HPWebdeveloper committed Feb 5, 2024
1 parent 3bf28bf commit 1d3ddcb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Http/Controllers/FailedJobsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;


class FailedJobsController extends Controller
Expand Down Expand Up @@ -42,6 +43,16 @@ protected function decodeDatabaseFailedJob($job)

public function show($uuid)
{
// Validate the UUID
$validator = Validator::make(['uuid' => $uuid], [
'uuid' => 'required|uuid',
]);

// Check if validation fails
if ($validator->fails()) {
return response()->json(['message' => 'Invalid UUID format'], 400);
}

$failedJob = DB::table('failed_jobs')->where('uuid', $uuid)->first();

if (!$failedJob) {
Expand Down

0 comments on commit 1d3ddcb

Please sign in to comment.