isMethod('POST')) { return [ 'title' => 'required', 'job_type' => 'required', 'region' => 'required', 'email' => 'required', 'details' => 'required', 'location' => 'required', 'data_posted' => 'required', 'salary' => 'required', 'status' => 'required', 'image' => 'required', ]; } // Validation rule for update request. if ($request->isMethod('PUT') || $request->isMethod('PATCH')) { return [ 'title' => 'required', 'job_type' => 'required', 'region' => 'required', 'email' => 'required', 'details' => 'required', 'location' => 'required', 'data_posted' => 'required', 'salary' => 'required', 'status' => 'required', 'image' => 'required', ]; } // Default validation rule. return [ ]; } }