object(Illuminate\Database\Eloquent\Collection)#175 (1) { ["items":protected]=> array(10) { [0]=> object(App\Models\Price)#205 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(1) ["store_id"]=> int(1) ["product_id"]=> int(1) ["price"]=> string(3) "500" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["original":protected]=> array(6) { ["id"]=> int(1) ["store_id"]=> int(1) ["product_id"]=> int(1) ["price"]=> string(3) "500" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [1]=> object(App\Models\Price)#206 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(2) ["store_id"]=> int(2) ["product_id"]=> int(1) ["price"]=> string(4) "2000" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["original":protected]=> array(6) { ["id"]=> int(2) ["store_id"]=> int(2) ["product_id"]=> int(1) ["price"]=> string(4) "2000" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [2]=> object(App\Models\Price)#207 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(3) ["store_id"]=> int(3) ["product_id"]=> int(1) ["price"]=> string(4) "3000" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["original":protected]=> array(6) { ["id"]=> int(3) ["store_id"]=> int(3) ["product_id"]=> int(1) ["price"]=> string(4) "3000" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [3]=> object(App\Models\Price)#208 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(4) ["store_id"]=> int(4) ["product_id"]=> int(1) ["price"]=> string(4) "4000" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["original":protected]=> array(6) { ["id"]=> int(4) ["store_id"]=> int(4) ["product_id"]=> int(1) ["price"]=> string(4) "4000" ["created_at"]=> string(19) "2016-04-05 12:57:17" ["updated_at"]=> string(19) "2016-04-05 12:57:17" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [4]=> object(App\Models\Price)#209 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(5) ["store_id"]=> int(5) ["product_id"]=> int(1) ["price"]=> string(4) "5000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["original":protected]=> array(6) { ["id"]=> int(5) ["store_id"]=> int(5) ["product_id"]=> int(1) ["price"]=> string(4) "5000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [5]=> object(App\Models\Price)#210 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(6) ["store_id"]=> int(6) ["product_id"]=> int(1) ["price"]=> string(4) "6000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["original":protected]=> array(6) { ["id"]=> int(6) ["store_id"]=> int(6) ["product_id"]=> int(1) ["price"]=> string(4) "6000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [6]=> object(App\Models\Price)#211 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(7) ["store_id"]=> int(7) ["product_id"]=> int(1) ["price"]=> string(4) "7000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["original":protected]=> array(6) { ["id"]=> int(7) ["store_id"]=> int(7) ["product_id"]=> int(1) ["price"]=> string(4) "7000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [7]=> object(App\Models\Price)#212 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(8) ["store_id"]=> int(8) ["product_id"]=> int(1) ["price"]=> string(4) "8000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["original":protected]=> array(6) { ["id"]=> int(8) ["store_id"]=> int(8) ["product_id"]=> int(1) ["price"]=> string(4) "8000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [8]=> object(App\Models\Price)#213 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(9) ["store_id"]=> int(9) ["product_id"]=> int(1) ["price"]=> string(4) "9000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["original":protected]=> array(6) { ["id"]=> int(9) ["store_id"]=> int(9) ["product_id"]=> int(1) ["price"]=> string(4) "9000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } [9]=> object(App\Models\Price)#214 (23) { ["table":protected]=> string(6) "prices" ["connection":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(6) { ["id"]=> int(10) ["store_id"]=> int(10) ["product_id"]=> int(1) ["price"]=> string(5) "10000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["original":protected]=> array(6) { ["id"]=> int(10) ["store_id"]=> int(10) ["product_id"]=> int(1) ["price"]=> string(5) "10000" ["created_at"]=> string(19) "2016-04-05 12:57:18" ["updated_at"]=> string(19) "2016-04-05 12:57:18" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["fillable":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) } } }
There is such a var_damp. When executing this code:
$min_price = Price::where('product_id','=',$id)->min('price'); $max_price = Price::where('product_id','=',$id)->max('price');
Instead of the minimum value of 500, it returns 10,000, and instead of 10,000 it returns 9,000. How to get min, max values from this dump?
soft_delete
and the string is notdeleted
? By default, whensoft_delete
search is performed by non-deleted entries - apelsinka223