Skip to content

[12.x] only use and document the limit and offset methods #10516

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

Merged
merged 1 commit into from
Jun 22, 2025

Conversation

browner12
Copy link
Contributor

skip() and take() are alias methods to offset() and limit(). IMO we should only use and document the main methods, not the aliases. This will encourage more performant coding, just like we now do in laravel/framework.

IF it's decided we still want to mention the aliases, I'd recommended listing them second as the alternatives. I can make that change if desired.

follow up to laravel/framework#56080 and laravel/framework#56081

`skip()` and `take()` are alias methods to `offset()` and `limit()`. IMO we should only use and document the main methods, not the aliases.  This will encourage more performant coding, just like we now do in `laravel/framework`.

IF it's decided we still want to mention the aliases, I'd recommended listing them second as the alternatives.  I can make that change if desired.
@shaedrich
Copy link
Contributor

Well, what do we have aliases for if we make sure nobody knows about them?

@browner12
Copy link
Contributor Author

agreed, we should get rid of the aliases. but we can't because of BC.

@shaedrich
Copy link
Contributor

shaedrich commented Jun 20, 2025

we should get rid of the aliases

Well, that is your opinion.

And I'm sure, Taylor has something to say about that, too.

@AhmedAlaa4611
Copy link
Contributor

Proposal

Remove skip() and take() in Laravel 13 to reduce ambiguity and enforce consistency with SQL terminology. As aliases for offset() and limit(), they introduce unnecessary abstraction.

I appreciate that skip() and take() have served as convenient aliases for many developers, especially those newer to SQL. However, after gaining a deeper understanding of the underlying SQL concepts, I believe these methods can be misleading.

Since Laravel 13 will allow for breaking changes, this might be an appropriate opportunity to consider removing skip() and take() from the core.

@shaedrich
Copy link
Contributor

shaedrich commented Jun 21, 2025

I appreciate that skip() and take() have served as convenient aliases for many developers, especially those newer to SQL.

If you are looking for a lean framework, Laravel might not be what you are looking for. Laravel is and always has been a framework that offered multiple ways of doing something.

@taylorotwell taylorotwell merged commit 84b7201 into laravel:12.x Jun 22, 2025
@browner12 browner12 deleted the AB-offset-limit branch June 23, 2025 14:14
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.

4 participants