wip
This commit is contained in:
35
app/Http/Controllers/UserDocController.php
Normal file
35
app/Http/Controllers/UserDocController.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
|
||||
class UserDocController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$files = scandir(public_path($request->folder));
|
||||
|
||||
return Blade::render('
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Files</title>
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
@foreach($lists as $list)
|
||||
<li><a href="{{ url($link_folder) }}/{{ $list }}">{{ $list }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
', [
|
||||
'link_folder' => $request->folder,
|
||||
'lists' => array_filter($files, fn ($data) => ! ($data == '.' || $data == '..')),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user