2021-05-02 17:24:05 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
2025-05-04 15:52:08 +07:00
|
|
|
use App\Jobs\SettleClaim;
|
2025-01-19 14:37:00 +08:00
|
|
|
use App\Models\PluginStore;
|
2025-05-02 23:27:16 +07:00
|
|
|
use App\Models\Setting;
|
|
|
|
|
use App\Repositories\TokenRepository;
|
2021-05-02 17:24:05 +08:00
|
|
|
use App\Repositories\ToolRepository;
|
2025-02-15 03:15:45 +08:00
|
|
|
use App\Repositories\UploadRepository;
|
2021-05-02 17:24:05 +08:00
|
|
|
use Illuminate\Http\Request;
|
2025-04-17 01:39:40 +07:00
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
2022-03-31 16:28:08 +08:00
|
|
|
use Illuminate\Support\Facades\Auth;
|
2025-01-19 14:37:00 +08:00
|
|
|
use Symfony\Component\Process\Process;
|
|
|
|
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
2024-04-01 02:35:11 +08:00
|
|
|
use Telegram\Bot\Api;
|
|
|
|
|
use Telegram\Bot\Commands\HelpCommand;
|
2021-05-02 17:24:05 +08:00
|
|
|
|
|
|
|
|
class ToolController extends Controller
|
|
|
|
|
{
|
|
|
|
|
private $repository;
|
|
|
|
|
|
|
|
|
|
public function __construct(ToolRepository $repository)
|
|
|
|
|
{
|
|
|
|
|
$this->repository = $repository;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-31 16:28:08 +08:00
|
|
|
public function notifications(): array
|
|
|
|
|
{
|
|
|
|
|
$user = Auth::user();
|
|
|
|
|
$result = $this->repository->getNotificationCount($user);
|
|
|
|
|
return $this->success($result);
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-01 14:18:30 +07:00
|
|
|
public function error(Request $request)
|
|
|
|
|
{
|
|
|
|
|
return view('error', ['error' => $request->query('error')]);
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-02 17:24:05 +08:00
|
|
|
}
|