Can I ignore an observer for a specific save method called?
I have this in the observer:
public function saved(Item $item){
// event stuff
$event->save();
}
Then I call a save method on the Item class:
public function update_item_notes()
{
// item stuff
$item->save();
}
The method is just to update the row, but the save observer is for when a new row is created...
Currently when updating the row in my method it calls the save observer...
There are three model events
creating
andcreated
: called for new data onlyupdating
andupdated
: called for update data onlysaving
andsaved
: called when both new and updated dataSo change your model event from
saved()
tocreated()
and it will only be called for new rows.