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

34 lines
695 B
PHTML

<?php
namespace App\Http\Controllers;
1 year ago
use Illuminate\Http\Request;
use Illuminate\Support\Str;
class GeneralController extends Controller
{
public function index()
{
return inertia('Dashboard');
}
public function maintance()
{
return inertia('Maintance');
}
1 year ago
public function upload(Request $request)
{
$request->validate(['image' => 'required|file']);
$file = $request->file('image');
$file->store('uploads', 'public');
return response()->json([
'id' => Str::ulid(),
'name' => $file->getClientOriginalName(),
'url' => asset($file->hashName('uploads')),
]);
}
}