Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Razdan's avatar

Is there a way a can bypass the format? (Laravel Exporting)

Greetings everyone. Currently i'm working with a export plugin where i was instructed to export data to excel everything works on my end but were i need the field to display example Credit Card Number (CCN) of 16 characters it round it. I have tried many tweaks, i even tried to format the column but it never worked in most cases.

My question "Is there a way a can bypass the format?".

Here is the Export Code: ' public function columnFormats(): array { return [ 'X' => NumberFormat::FORMAT_NUMBER, 'P' => NumberFormat::FORMAT_CURRENCY_USD, ]; }

0 likes
3 replies
Razdan's avatar

Here is the Code

public function view(): View{ $guests=Guest::all(); return view('form.export',compact('guests')); }

The P column works which add the $ sign

slev1n's avatar

You can highlight code blocks:

    ```
        public function some()
        {
            // do stuff
        }
    ```

Are you tried format CCN like string?

Please or to participate in this conversation.