Auto increment field in the table.
Guys, I have a problem here. I need an auto increment field in my table. I tried using BigIncrements, however, as I have an id field that already has a primary key, I was unable to use it. Would there be another way to increase the table? I just can't use the id, I have to create another field for that.
2 Replies
This is for Filament, you'd be better off with an RDBMS forum.
However, since you're here...you don't need two autoincrement fields...something is wrong with your design.
https://laravel-news.com/working-with-laravel-model-events you can use creating event to do incrementation
Laravel News
Working with Laravel Model Events - Laravel News
When working with Eloquent Models, it is common to tap into the events dispatched through the Models lifecycle.