You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For testing I've created a Provider with custom functions to dish out fake data for my model's factory.
I have a function that returns 2 random amenities in an array using ->randomElements from faker. One of these items is "Storage".
If Storage happens to be the first item in that array, the factory will die with an error of BadMethodCallException with message 'Call to undefined method League\Flysystem\Filesystem::Restaurant'
(Restaurant is replaceable with whatever the second element of that array might be.)
I've tracked it down to FactoryBuilder@expandAttributes, where I guess it's overlapping with the Storage facade?
To get around this I can json_encode the fields, but this model does indeed cast that field as an array/json, so I feel like this should be safe to do.
$casts = [
...
"amenities" => "array",
...
]
Steps To Reproduce:
Have a factory return an element that contains an array with the first element being Storage, second element can be anything.
$factory->define( ... your model ..., function() {
return [
"foo" => ["Storage", "Bar"]
]
}
See error BadMethodCallException with message 'Call to undefined method League\Flysystem\Filesystem::Bar'
The text was updated successfully, but these errors were encountered:
Description:
Hey there,
For testing I've created a Provider with custom functions to dish out fake data for my model's factory.
I have a function that returns 2 random amenities in an array using
->randomElements
from faker. One of these items is "Storage".If Storage happens to be the first item in that array, the factory will die with an error of
BadMethodCallException with message 'Call to undefined method League\Flysystem\Filesystem::Restaurant'
(Restaurant is replaceable with whatever the second element of that array might be.)
I've tracked it down to
FactoryBuilder@expandAttributes
, where I guess it's overlapping with the Storage facade?To get around this I can json_encode the fields, but this model does indeed cast that field as an array/json, so I feel like this should be safe to do.
Steps To Reproduce:
Storage
, second element can be anything.BadMethodCallException with message 'Call to undefined method League\Flysystem\Filesystem::Bar'
The text was updated successfully, but these errors were encountered: