<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
|
use Illuminate\Routing\Controller as BaseController;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\Bucket;
|
|
use App\Facades\FileManager;
|
|
|
|
class FileController extends BaseController
|
|
{
|
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
|
|
|
/**
|
|
*
|
|
* @return object
|
|
*
|
|
*/
|
|
public function index(Request $request, $id)
|
|
{
|
|
$path = $request->get('path');
|
|
|
|
// create bucket
|
|
$bucket = Bucket::find($id);
|
|
|
|
// getting files
|
|
$files = FileManager::find($bucket->path.'/'.$path);
|
|
|
|
return response()->json([
|
|
'files' => $files
|
|
]);
|
|
}
|
|
}
|