Expose serializer/actor to extensions

This commit is contained in:
Toby Zerner 2015-05-15 17:06:09 +09:30
parent b4e5f0e6e5
commit 8e6adb9be0
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ use Closure;
*/
abstract class BaseSerializer extends SerializerAbstract
{
protected $actor;
public $actor;
/**
* The custom relationships on this serializer.

View File

@ -87,7 +87,7 @@ class ServiceProvider extends IlluminateServiceProvider
{
$this->app['events']->listen('Flarum\Api\Events\SerializeAttributes', function ($event) use ($serializer, $callback) {
if ($event->serializer instanceof $serializer) {
$callback($event->attributes, $event->model);
$callback($event->attributes, $event->model, $event->serializer);
}
});
}