Fix errors in DeleteAvatarAction/Command

This commit is contained in:
Toby Zerner 2015-05-19 09:26:39 +09:30
parent eb403d7bae
commit 927f6e3c9b
2 changed files with 10 additions and 4 deletions

View File

@ -41,7 +41,7 @@ class DeleteAvatarAction extends SerializeResourceAction
protected function data(JsonApiRequest $request, JsonApiResponse $response)
{
return $this->bus->dispatch(
new DeleteAvatarCommand($request->get('id'), $this->actor->getUser())
new DeleteAvatarCommand($request->get('id'), $request->actor->getUser())
);
}
}

View File

@ -78,11 +78,17 @@ class CoreServiceProvider extends ServiceProvider
'Flarum\Core\Repositories\EloquentActivityRepository'
);
$avatarFilesystem = function (Container $app) {
return $app->make('Illuminate\Contracts\Filesystem\Factory')->disk('flarum-avatars')->getDriver();
};
$this->app->when('Flarum\Core\Handlers\Commands\UploadAvatarCommandHandler')
->needs('League\Flysystem\FilesystemInterface')
->give(function (Container $app) {
return $app->make('Illuminate\Contracts\Filesystem\Factory')->disk('flarum-avatars')->getDriver();
});
->give($avatarFilesystem);
$this->app->when('Flarum\Core\Handlers\Commands\DeleteAvatarCommandHandler')
->needs('League\Flysystem\FilesystemInterface')
->give($avatarFilesystem);
}
public function registerGambits()