You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
  4. use Illuminate\Foundation\Bus\DispatchesJobs;
  5. use Illuminate\Foundation\Validation\ValidatesRequests;
  6. use Illuminate\Routing\Controller as BaseController;
  7. use Illuminate\Http\Request;
  8. use App\Models\Bucket;
  9. use App\Facades\FileManager;
  10. class FileController extends BaseController
  11. {
  12. use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
  13. /**
  14. *
  15. * @return object
  16. *
  17. */
  18. public function index(Request $request, $id)
  19. {
  20. $path = $request->get('path');
  21. // create bucket
  22. $bucket = Bucket::find($id);
  23. // getting files
  24. $files = FileManager::find($bucket->path.'/'.$path);
  25. return response()->json([
  26. 'files' => $files
  27. ]);
  28. }
  29. /**
  30. *
  31. *
  32. * @param Request $request [description]
  33. * @param [type] $id [description]
  34. * @return [type] [description]
  35. */
  36. public function upload(Request $request, $id)
  37. {
  38. // create bucket
  39. $bucket = Bucket::find($id);
  40. }
  41. }