File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function boot()
2525{
2626
2727$ this ->publishes ([
28- __DIR__ .'/../config/irfa/ ' => config_path ('irfa ' )], 'file-safe ' );
28+ __DIR__ .'/../config/irfa/ ' => config_path ('irfa ' ) ], 'file-safe ' );
2929
3030
3131}
Original file line number Diff line number Diff line change 99class CryptFile extends File
1010{
1111private static $ file ;
12- protected static function encrypt ($ file ){
12+ protected static function encrypt ($ file ) {
1313$ fileContent = $ file ->get ();
1414self ::$ file = $ file ;
1515$ encryptedContent = Crypt::encrypt ($ fileContent );
16- self ::store_file (self ::GenerateFileName (),$ encryptedContent );
16+ self ::store_file (self ::GenerateFileName (), $ encryptedContent );
1717
1818self ::$ file = null ;
1919
2020
2121}
2222
23- protected static function decrypt ($ file ,$ raw= false ){
23+ protected static function decrypt ($ file , $ raw = false ) {
2424$ fl = self ::get_file ($ file );
2525$ decryptedContent = Crypt::decrypt ($ fl );
26- if ($ raw ){
26+ if ($ raw ) {
2727$ raw = $ decryptedContent ;
2828return $ raw ;
29- } else {
29+ } else {
3030
3131return response ()->streamDownload (function () use ($ decryptedContent ) {
3232echo $ decryptedContent ;
3333}, $ file );
3434}
3535}
36- private static function GenerateFileName (){
37- if (config ("irfa.filesafe.random_filename " )){
36+ private static function GenerateFileName () {
37+ if (config ("irfa.filesafe.random_filename " )) {
3838$ rand = time ()."_ " .Str::random (20 ).". " .self ::$ file ->getClientOriginalExtension ();
39- } else {
39+ } else {
4040$ rand = self ::$ file ->getClientOriginalName ();
4141}
4242return $ rand ;
You can’t perform that action at this time.
0 commit comments