Support the ongoing development of Laravel.io →
Input Eloquent Forms

Hi, I'm a new developer in Laravel. I made a Portfolio Management system in Personal Banking for our course in University. Everything looks fine but I have a little problem in "Add Costumer" part.

In my "Add Costumer" part, I have a five input area. That's,

  • Customer Name/Surname
  • Customer ID Number -> (I have a problem in here)
  • Customer Job
  • Customer Birthday
  • Customer Adress

When the user click "Save" button, my controller generate random custom number and this number put in "customer_no" field.

       $group_id = Auth::user()->id;
        $number = rand();

        $collection = collect($request->all());
        $collection -> put('customer_no', $number); // Random Customer No
        $collection -> put('user_id', $group_id); // For Relationship

        return dd(Customer::create($collection -> all())); 

My problem start in "Customer ID" input area. Because, When I click save button, customer id field was making wrong insert. It's always insert same number "2147483647". Also, I checked my return dd result. I can see right customer id number in my array.

For ex,

The value I entered -> 19212364187 Saved in database -> 2147483647

I can't resolve this problem. Could you help me for this? I tried "php artisan clear:cache, php artisan migrate:reset" but doesn't work.

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

TKarahan tkarahan Joined 6 Mar 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.