Closed darkcyber closed 9 years ago
I don't have a solid answer for you if it's possible but I will say that it goes against convention. Typically this would be a foreign key referencing post
. id
. You're probably going to need to change the $primaryKey
variable in your Post.php
model as well.
Don't know your level with php or laravel but I would strongly suggest sticking with the standards so in the future people can help you and mitigate any possible problems before they occur. Good luck.
"id" is default Laravel primary key convention, if you want change to other, you may define a primaryKey property to override the convention.
@idhamperdameian Thanks, i just need to create fields for primary key then define in model files for $primaryKey.
Hello,
By default this generator will create "id" as primary key in the migration file , then i want to ask how to change "id" with something like "post_id" as primary key , so in the migration file only post_id fields and the other not "id","post_id", and the other ? So is there any way to change default id fields ? or we must change it manually in the migration file ?
Thanks.