This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h4>Your files</h4> | |
| <ul class="list-group"> | |
| @forelse ($s3Files as $file) | |
| <li class="list-group-item"> | |
| <a href="{{ route('downloadFile', basename($file)) }}"> | |
| {{ basename($file) }} | |
| </a> | |
| </li> | |
| @empty | |
| <li class="list-group-item">You have no files</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Controllers; | |
| use App\Jobs\EncryptFile; | |
| use App\Jobs\MoveFileToS3; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Storage; | |
| use Illuminate\Support\Str; | |
| use SoareCostin\FileVault\Facades\FileVault; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Jobs; | |
| use Exception; | |
| use Illuminate\Bus\Queueable; | |
| use Illuminate\Contracts\Queue\ShouldQueue; | |
| use Illuminate\Foundation\Bus\Dispatchable; | |
| use Illuminate\Http\File; | |
| use Illuminate\Queue\InteractsWithQueue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Jobs; | |
| use Illuminate\Bus\Queueable; | |
| use Illuminate\Contracts\Queue\ShouldQueue; | |
| use Illuminate\Foundation\Bus\Dispatchable; | |
| use Illuminate\Queue\InteractsWithQueue; | |
| use Illuminate\Queue\SerializesModels; | |
| use SoareCostin\FileVault\Facades\FileVault; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul class="list-group"> | |
| @forelse ($files as $file) | |
| <li class="list-group-item"> | |
| <a href="{{ route('downloadFile', basename($file)) }}"> | |
| {{ basename($file) }} | |
| </a> | |
| </li> | |
| @empty | |
| <li class="list-group-item">You have no files</li> | |
| @endforelse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Download a file | |
| * | |
| * @param string $filename | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function downloadFile($filename) | |
| { | |
| // Basic validation to check if the file exists and is in the user directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Store a user uploaded file | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function store(Request $request) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Show the application dashboard. | |
| * | |
| * @return \Illuminate\Contracts\Support\Renderable | |
| */ | |
| public function index() | |
| { | |
| $files = Storage::files('files/' . auth()->user()->id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action="{{ route('uploadFile') }}" method="post" enctype="multipart/form-data" class="my-4"> | |
| @csrf | |
| <div class="form-group"> | |
| <div class="custom-file"> | |
| <input type="file" class="custom-file-input" id="userFile" name="userFile"> | |
| <label class="custom-file-label" for="userFile">Choose a file</label> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Store a user uploaded file | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function store(Request $request) | |
| { |