mirror of
https://github.com/flarum/framework.git
synced 2025-02-27 02:29:39 +08:00
Expose serializer/actor to extensions
This commit is contained in:
parent
b4e5f0e6e5
commit
8e6adb9be0
@ -11,7 +11,7 @@ use Closure;
|
|||||||
*/
|
*/
|
||||||
abstract class BaseSerializer extends SerializerAbstract
|
abstract class BaseSerializer extends SerializerAbstract
|
||||||
{
|
{
|
||||||
protected $actor;
|
public $actor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The custom relationships on this serializer.
|
* The custom relationships on this serializer.
|
||||||
|
@ -87,7 +87,7 @@ class ServiceProvider extends IlluminateServiceProvider
|
|||||||
{
|
{
|
||||||
$this->app['events']->listen('Flarum\Api\Events\SerializeAttributes', function ($event) use ($serializer, $callback) {
|
$this->app['events']->listen('Flarum\Api\Events\SerializeAttributes', function ($event) use ($serializer, $callback) {
|
||||||
if ($event->serializer instanceof $serializer) {
|
if ($event->serializer instanceof $serializer) {
|
||||||
$callback($event->attributes, $event->model);
|
$callback($event->attributes, $event->model, $event->serializer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user