kodeine / laravel-meta

Fluent Meta Data for Eloquent Models, as if it is a property on your model
MIT License
400 stars 90 forks source link

Breaking change from master to 2.2.1 #107

Closed dhcmega closed 10 months ago

dhcmega commented 11 months ago

Hi! I have this simplified scenario:

$ticket = Ticket::find(1);
$ticket->images = Media::getMedia($ticket->id); // might be null

return \Response::json(['mesg' => $message, 'data' => $ticket));

With master this works ok. With 2.2.1 images is deleted. Can I prevent this? I had to roll back at the moment

Thanks

dhcmega commented 10 months ago

Any ideas on why I can no longer "create" props on a model as an object? Thanks

dhcmega commented 10 months ago

Ok, this is the case:

  1. all new dynamically props added to a model with metable will be a meta
  2. is you need a dynamic prop of a model that should no be a meta, you can do it as $item->setAttribute('test', 'hello'); thanks
dhcmega commented 10 months ago

closed