Closed slince closed 7 years ago
Hey @slince ,
there is currently no "official" way to add custom trackers. But you can simply put your implementation under the Sauladam\ShipmentTracker\Trackers
namespace to make this package aware of it:
<?php
namespace Sauladam\ShipmentTracker\Trackers;
class MyNewTracker {
// your implementation here
}
Then you can simply use it with ShipmentTracker::get('MyNewTracker');
. Just make sure your class is autoloaded, e.g. by adding it to the autoload-section in your composer.json file:
"classmap": [
"path/to/MyNewTracker.php"
]
You could also extend Sauladam\ShipmentTracker\Trackers\AbstractTracker
for some boilerplate if you need it.
I'll try to come up with a more convenient way to add custom trackers. And if you already have one, feel free to PR it :)
@sauladam OK PS: I love your avatar
@sauladam Hi ! I have created a PR to resolve this.
@sauladam Hi, Will you accept this PR? I now need to use this feature.
I've merged your PR, thank you!
@slince Can you make a PR with an update to the documentation?
The library is very surprise. however i want register a tracker. Do you have any idea?