user()?->can(Permission::STOCKS_VIEW->value) ?? false; } /** * @return array */ public function rules(): array { return [ 'product_variant_id' => [ 'required', 'integer', Rule::exists('product_variants', 'id')->whereNull('deleted_at'), ], 'quantity' => ['required', 'integer', 'min:1'], 'notes' => ['nullable', 'string', 'max:500'], ]; } /** * @return array */ public function attributes(): array { return [ 'product_variant_id' => 'Varian Produk', 'quantity' => 'Jumlah', 'notes' => 'Catatan', ]; } }