Answers for "laravel get the last row array"

PHP
4

laravel get last 5 records

Dogs::latest()->take(5)->get();
Posted by: Guest on May-23-2021
1

array_last in laravel 8

use Illuminate\Support\Arr;

$array = [100, 200, 300, 110];

$last = Arr::last($array, function ($value, $key) {
    return $value >= 150;
});

// 300
Posted by: Guest on September-21-2021

Code answers related to "laravel get the last row array"

Browse Popular Code Answers by Language