user()?->can(Permission::PURCHASES_CREATE->value) ?? false; } /** * @return array */ public function rules(): array { return [ 'raw_material_price_id' => [ 'required', 'integer', Rule::exists('raw_material_prices', 'id')->whereNull('deleted_at'), ], 'quantity' => ['required', 'numeric', 'decimal:0,4', 'gt:0'], 'photos' => ['nullable', 'array', 'max:5'], 'photos.*' => ['image', 'mimes:jpg,jpeg,png,webp', 'max:5120'], 's3_keys' => ['nullable', 'array', 'max:5'], 's3_keys.*' => ['nullable', 'string'], ]; } }