Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPORM-243 Alias _id to id in Schema::getColumns() #3160

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Sep 20, 2024

Fix PHPORM-243

❯ php artisan model:show book

  App\Models\Book .............................................................  
  Database ............................................................ mongodb  
  Table ................................................................. books  

  Attributes ...................................................... type / cast  
- _id ..................................................... objectId / accessor  
+ id ...................................................... objectId / accessor   
  author nullable ...................................................... string  
  created_at nullable ......................................... date / datetime  
  description nullable ................................................. string  
  isbn nullable ........................................................ string  
  publication_date nullable ............................................ string  
  title nullable ....................................................... string  
  updated_at nullable ......................................... date / datetime  
-  id ................................................................. accessor  

Required for API Platform integration with Laravel: https://github.com/api-platform/laravel/blob/e821ad27072228e4638f3de92d51fc3d15e02c7b/Eloquent/Metadata/ModelMetadata.php#L68

Checklist

  • Add tests and ensure they pass
  • Add an entry to the CHANGELOG.md file

@GromNaN GromNaN modified the milestones: 5.0, 5.1 Sep 20, 2024
@GromNaN GromNaN marked this pull request as ready for review September 20, 2024 10:05
@GromNaN GromNaN requested a review from a team as a code owner September 20, 2024 10:05
Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit regarding a comment, but LGTM other than that

src/Schema/Builder.php Outdated Show resolved Hide resolved
Co-authored-by: Andreas Braun <[email protected]>
@GromNaN GromNaN enabled auto-merge (squash) September 20, 2024 11:53
@GromNaN GromNaN enabled auto-merge (squash) September 20, 2024 11:54
@GromNaN GromNaN merged commit 716d8e1 into mongodb:5.x Sep 20, 2024
27 checks passed
@GromNaN GromNaN deleted the PHPORM-243 branch September 20, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants