F
Filament3mo ago
Myster

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
Matthew
Matthew3mo ago
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.
adaoss
adaoss3mo ago
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.
Want results from more Discord servers?
Add your server