Wednesday, 21 April 2021

Laravel eloquent get name of primary key

 just call the model's getKeyName() function

or (new Model)->getKeyName()


https://laracasts.com/discuss/channels/laravel/get-primary-key-field-name


https://laravel.com/api/5.8/Illuminate/Database/Eloquent/Model.html

No comments:

Post a Comment