It would help if you show us the code you have now, but with no input, this is an idea i came up with. Not necessarily a clean way of doing it (that's up to you ;) ), but one method that will always work is manual validation. Here some psuedo code:
//
<?php
namespace App\Http\Controllers;
use Validator;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
SomeController extends Controller {
public function someAction(Request $request){
// Validate if we have a file
$this->validate(['font' => 'file']);
// Get the file
$font = $request->file('font');
$fontFilename = $font->getClientOriginalName();
// 1) Check if exists in storage
// Assuming the filename is not altered when uploaded
// .. Do database validation here, and return some boolean
$existsInDatabase = true;
$existsInStorage = file_exists( base_path().'/path/to/'.$fontFilename);
if( ! ($existsInDatabase && $existsInStorage) ){
// 2) If new file uploaded by form check its mimes type
$this->validate(['font' => 'mimes:tff,woff');
}
}
}
Edit: removed some mistakes