how to check if the resource is being created or updated? - Filament