eloquent limit vs take

Solutions on MaxInterview for eloquent limit vs take by the best coders in the world

showing results for - "eloquent limit vs take"
Dylan
18 Jun 2020
1"limit" only works on eloquent ORM or query builder objects 
2whereas "take" works on both collections and the ORM or Query Builder objects.
3
4Model::get()->take(20);   // Correct
5Model::get()->limit(20);  // Incorrect
6
7Model::take(20)->get()    // Correct
8Model::limit(20)->get()   // Correct