@@ -4,6 +4,7 @@ use App\Models\Organization;
|
||||
use App\Models\Setting;
|
||||
use Flux\Flux;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
@@ -12,9 +13,7 @@ new #[Title('Plan pricing')] class extends Component
|
||||
{
|
||||
public function mount(): void
|
||||
{
|
||||
if (! auth()->user()->isAdmin()) {
|
||||
abort(403);
|
||||
}
|
||||
Gate::authorize('accessAdmin');
|
||||
|
||||
$this->amounts = $this->plans()
|
||||
->mapWithKeys(fn (array $plan): array => [
|
||||
@@ -61,6 +60,8 @@ new #[Title('Plan pricing')] class extends Component
|
||||
|
||||
public function saveAmounts(): void
|
||||
{
|
||||
Gate::authorize('accessAdmin');
|
||||
|
||||
$validated = $this->validate([
|
||||
'amounts' => ['required', 'array'],
|
||||
'amounts.*' => ['required', 'numeric', 'min:0', 'decimal:0,2'],
|
||||
|
||||
Reference in New Issue
Block a user