generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hi!
During the insert, the library operate in three steps:
- It caches all the original geometries attributes as their defined type (a point as Point, and so on...) and convert all geometries as Expression.
- It performs insert using the eloquent
performInsertmethod - It refills the model attributes as their original states
The problem here is that if you use the laravel eloquent model event:
class Person
{
use \Clickbar\Magellan\Database\Eloquent\HasPostgisColumns;
/** @var string[] */
protected $postgisColumns = [
'location' => [
'type' => 'geometry',
'srid' => 4326
]
];
protected $dispatchesEvents = [
'created' => \App\Events\Person\Created::class
];
}The event is dispatched from the eloquent performInsert call, meaning it's called with all the geometries attributes as Expression and not as Point.
I'll investigate if there is some kind of hook inside the Eloquent model event dispatcher to see if this could be fixed properly.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working