Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DashboardController | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __invoke | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Controllers\Admin; |
| 4 | |
| 5 | use App\Http\Controllers\Concerns\ResolvesContext; |
| 6 | use App\Http\Controllers\Controller; |
| 7 | use App\Models\Order; |
| 8 | use App\Services\DashboardMetricsService; |
| 9 | use Illuminate\View\View; |
| 10 | |
| 11 | class DashboardController extends Controller |
| 12 | { |
| 13 | use ResolvesContext; |
| 14 | |
| 15 | public function __invoke(DashboardMetricsService $metrics): View |
| 16 | { |
| 17 | $store = $this->currentStore(); |
| 18 | |
| 19 | return view('admin.dashboard', [ |
| 20 | 'store' => $store, |
| 21 | 'metrics' => $metrics->admin($store), |
| 22 | 'latestOrders' => Order::query()->with('influencer', 'commission')->where('store_id', $store->id)->latest()->limit(8)->get(), |
| 23 | ]); |
| 24 | } |
| 25 | } |