Skip to content

Conversation

JustSteveKing
Copy link

Adding a PaginatedResult interface with generics to allow for better typed pagination between Laravel and Inertia/Vue.

An example implementation for you Inertia page, passing the generic type you expect to paginate through to the paginated result

const props = defineProps<{
  projects: PaginatedResult<Project>;
}>();

Replicating from: laravel/vue-starter-kit#98

Adding PaginatedResult interface
@tnylea
Copy link
Contributor

tnylea commented Apr 15, 2025

Rock'n 🤘 Thanks dude!

@tnylea tnylea added the Approved Approved for Merge label Apr 15, 2025
@Barbapapazes
Copy link

Hey! I really liked your idea, so I went ahead and built a small JavaScript package to make it easy to share common Laravel types across projects: https://github.com/barbapapazes/laravel-types.

It’s something I’ve had in mind for a few weeks, and seeing your PR was the push I needed to finally make it happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Approved for Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants