1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Http\Controllers;
- use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
- use Illuminate\Foundation\Bus\DispatchesJobs;
- use Illuminate\Foundation\Validation\ValidatesRequests;
- use Illuminate\Routing\Controller as BaseController;
- class Controller extends BaseController
- {
- use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
- public function ping()
- {
- return response()->redirectTo("/pc/");
- }
- public function upload()
- {
- $file = request()->file("file");
- $category = request()->input("category", "default");
- $path = "/storage/" . $file->store(date("Ymd") . "/" . $category, "public");
- return [
- "code" => 200,
- "data" => [
- "upload_url" => config("app.url") . $path,
- ],
- ];
- }
- }
|