classify admin

This commit is contained in:
Husanjonazamov
2026-02-24 12:52:01 +05:00
commit e0f1989655
769 changed files with 1263008 additions and 0 deletions

15
app/Rules/JsonFile.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
namespace App\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class JsonFile implements ValidationRule {
public function validate(string $attribute, mixed $value, Closure $fail): void {
if (($value instanceof \Illuminate\Http\UploadedFile) && $value->getClientOriginalExtension() != 'json' && !in_array($value->getMimeType(), ["application/json", "text/plain"])) {
$fail($attribute . ' must be a json file');
}
}
}