I have never used laravel and have no knowledge about it. I used it for uploading files to google drive. Now I have a file 'web.php' which upload the files.
<?php
use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
Route::get('/', function () {
return view('welcome');
});
Route::post('/upload', function (Request $request) {
$name=$request->file("thing")->getClientOriginalName();
Storage::disk("google")->putFileAs("",$request->file("thing"),$name);
})->name("upload");
the file which has HTML code is like this:
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Google drive integration in laravel</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-12">
<br><br><br>
<form action="/upload" method="post" enctype="multipart/form-data">
@csrf
<input type="file" class="form-control" name="thing" id="title">
<p id="s"></p>
<br>
<input type="submit" class="btn btn-sm btn-block btn-danger" value="Upload">
</form>
</div>
</div>
</div>
</body>
</html>
I want that from the web.php file, i get $name and display the value in my HTML code div. How can I possibly do this?