1. Go to this page and download the library: Download abdian/laravel-upload-guard library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
abdian / laravel-upload-guard example snippets
// One rule. Fail-closed by default.
$request->validate([
'file' => '
public function store(\Illuminate\Http\Request $request)
{
$request->validate([
'file' => '
$request->validate([
'file' => '
use Abdian\UploadGuard\Rules\Safeguard;
$request->validate([
'avatar' => ['
->stripMetadata(),
],
'document' => ['red', (new Safeguard)
->documentsOnly(), // archive + macro scanning are already on by default
],
]);