user_id/$filename"; // Check if file exist if (! Storage::exists($path)) { // Get original file path $substituteFilePath = "/files/$file->user_id/$file->basename"; // Check if original file exist if (! Storage::exists($substituteFilePath)) { abort(404); } // Return image thumbnail return Storage::download($substituteFilePath, $filename); } // Return image thumbnail return Storage::download($path, $filename); } }