SHARE
TWEET

Untitled

a guest Feb 21st, 2020 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     protected static function copyFiles (Podcast $podcast, Collection $episodes) : Collection
  2.     {
  3.         $files = [];
  4.         foreach ($episodes as $episode) {
  5.             $src = $episode->url;
  6.             $dst = $podcast->slug . '/' . $episode->slug . '.mp3';
  7.             if (Storage::exists($dst)) {
  8.                 Storage::delete($dst);
  9.             }
  10.             $name = Str::uuid() .'.'. $file->getClientOriginalExtension();
  11.             $t = [
  12.                 'name' => Storage::putFileAs('temp_storage', $request->file('episodeUpload')[0], $name),
  13.                 'link' => asset('storage/temp_storage/' . $name)
  14.             ];
  15.             if (Storage::exists($old_mp3)) {
  16.                 Storage::delete($old_mp3);
  17.             }
  18.         }
  19.  
  20.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top