In addition, Tinker is now also including hidden properties like password and remember_token when querying User. Same issue as above.
Tinker is returning only the Model namespace, without properties, only sometimes.
Why is this happening? See my first three queries that won't return any data, but using find() works great. I have cleared cache, routes, config. I've dumped autoload. I've downgraded versions. I've tried another project where it works as expected. If I add ->id to any of them, it works. Why??
> \Laravel\Cashier\Subscription::query()->where('id','=','3')->first()
= Laravel\Cashier\Subscription {#6527 …14}
> \Laravel\Cashier\Subscription::where('id',3)->get()->first()
= Laravel\Cashier\Subscription {#6954 …14}
> \Laravel\Cashier\Subscription::where('id',3)->first()
= Laravel\Cashier\Subscription {#5841 …14}
> \Laravel\Cashier\Subscription::find(3)
= Laravel\Cashier\Subscription {#6527
id: 3,
user_id: 1,
type: "1",
stripe_id: "3",
stripe_status: "active",
stripe_price: null,
quantity: null,
trial_ends_at: null,
ends_at: "2024-08-14 00:47:03",
created_at: null,
updated_at: null,
current_period_end: null,
event_status: null,
items: Illuminate\Database\Eloquent\Collection {#6525
all: [],
},
}
This is an issue of PsySH which was subject of some discussing on X thread and in the package's Github issues relating to what PsySH is interpreting either as actions or inspections. The repo owner is
Seems not to be configurable yet, so the workaround is either (i) use the $_ approach after the query to see the verbose, expanded result:
> \Laravel\Cashier\Subscription::find(3)
= Laravel\Cashier\Subscription {#5841 …14}
> $_
= Laravel\Cashier\Subscription {#5841
id: 3,
user_id: 1,
type: "1",
stripe_id: "3",
stripe_status: "active",
stripe_price: null,
quantity: null,
trial_ends_at: null,
ends_at: "2024-08-14 00:47:03",
created_at: null,
updated_at: null,
current_period_end: null,
event_status: null,
items: Illuminate\Database\Eloquent\Collection {#6525
all: [],
},
}
or, (ii) lock you psysh to max. version 0.12.12
composer require psy/psysh:0.12.12
Hopefully this will be configurable soon
Please or to participate in this conversation.