file.replace:before $file, $upload /site/config/config.php return [ 'hooks' => [ 'file.replace:before' => function ($file, $upload) { // your code goes here } ] ]