feat: implement module API routes, controllers, and comprehensive system testing with role-based access control
This commit is contained in:
@@ -468,7 +468,7 @@ class PurchaseOrderController extends Controller
|
||||
];
|
||||
|
||||
if ($hasFileInfo) {
|
||||
$rules['receipt'] .= '|mimes:pdf,jpg,jpeg,png';
|
||||
$rules['receipt'] .= '|mimes:pdf';
|
||||
}
|
||||
|
||||
$validated = $request->validate($rules);
|
||||
@@ -477,7 +477,7 @@ class PurchaseOrderController extends Controller
|
||||
|
||||
if (!$hasFileInfo) {
|
||||
$extension = strtolower($file->getClientOriginalExtension() ?: pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION));
|
||||
if (!in_array($extension, ['pdf', 'jpg', 'jpeg', 'png'])) {
|
||||
if ($extension !== 'pdf') {
|
||||
return back()->withErrors(['receipt' => 'The receipt must be a file of type: pdf, jpg, jpeg, png.']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user