25 lines
545 B
PHP
25 lines
545 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Routing\Controller as BaseController;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class FileController extends BaseController
|
|
{
|
|
public function index() {
|
|
return view("file.upload");
|
|
}
|
|
|
|
public function upload(Request $request)
|
|
{
|
|
if (!$request->hasFile("file")) {
|
|
return "";
|
|
}
|
|
$path = $request->file("file")->store("lubo_file");
|
|
$full_path = Storage::url($path);
|
|
return $full_path;
|
|
}
|
|
}
|