-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathUltraController.php
More file actions
37 lines (30 loc) · 915 Bytes
/
UltraController.php
File metadata and controls
37 lines (30 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace App\Http\Controllers;
use App\Enums\PluginStatus;
use App\Enums\PluginType;
use App\Models\Plugin;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;
class UltraController extends Controller
{
public function index(): View|RedirectResponse
{
$user = Auth::user();
if (! $user->hasActiveUltraSubscription()) {
return to_route('pricing');
}
$subscription = $user->subscription();
$plugins = Plugin::query()
->where('is_official', true)
->where('is_active', true)
->where('status', PluginStatus::Approved)
->where('type', PluginType::Paid)
->orderBy('name')
->get();
return view('customer.ultra.index', [
'subscription' => $subscription,
'plugins' => $plugins,
]);
}
}