Download app/Http/Controllers/DashboardController.php from veela4/gamtest: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/veela4/gamtest/resolve/main/app/Http/Controllers/DashboardController.php
- Command line
-
hf download hf://veela4/gamtest/app/Http/Controllers/DashboardController.php
-
curl -L -o DashboardController.php https://huggingface.co/veela4/gamtest/resolve/main/app/Http/Controllers/DashboardController.php
1.33 kB
| namespace App\Http\Controllers; | |
| use App\Services\AnalyticsService; | |
| use Illuminate\Http\Request; | |
| class DashboardController extends Controller | |
| { | |
| protected AnalyticsService $analyticsService; | |
| public function __construct(AnalyticsService $analyticsService) | |
| { | |
| $this->analyticsService = $analyticsService; | |
| } | |
| public function index() | |
| { | |
| try { | |
| $todayRevenue = $this->analyticsService->getTodayRevenue(); | |
| $profitData = $this->analyticsService->getProfitData('today'); | |
| $customerAnalytics = $this->analyticsService->getCustomerAnalytics(); | |
| $orderStats = $this->analyticsService->getOrderStats(); | |
| } catch (\Exception $e) { | |
| // Fallback values if service fails | |
| $todayRevenue = ['current' => 0, 'previous' => 0, 'percentage_change' => 0, 'trend' => 'up']; | |
| $profitData = ['profit_margin' => 0, 'percentage_change' => 0, 'trend' => 'up']; | |
| $customerAnalytics = ['total_customers' => 0, 'active_today' => 0]; | |
| $orderStats = ['current' => 0, 'previous' => 0, 'percentage_change' => 0, 'trend' => 'up']; | |
| } | |
| return view('dashboard', compact( | |
| 'todayRevenue', | |
| 'profitData', | |
| 'customerAnalytics', | |
| 'orderStats' | |
| )); | |
| } | |
| } | |