mirror of
https://github.com/flarum/framework.git
synced 2025-06-05 23:44:34 +08:00
Wire up instantiation of Flysystem adapter for avatar storage.
This commit is contained in:
@ -12,6 +12,7 @@ use Flarum\Core\Models\User;
|
|||||||
use Flarum\Core\Models\Discussion;
|
use Flarum\Core\Models\Discussion;
|
||||||
use Flarum\Core\Models\Notification;
|
use Flarum\Core\Models\Notification;
|
||||||
use Flarum\Core\Search\GambitManager;
|
use Flarum\Core\Search\GambitManager;
|
||||||
|
use League\Flysystem\Adapter\Local;
|
||||||
|
|
||||||
class CoreServiceProvider extends ServiceProvider
|
class CoreServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -83,6 +84,14 @@ class CoreServiceProvider extends ServiceProvider
|
|||||||
'Flarum\Core\Repositories\NotificationRepositoryInterface',
|
'Flarum\Core\Repositories\NotificationRepositoryInterface',
|
||||||
'Flarum\Core\Repositories\EloquentNotificationRepository'
|
'Flarum\Core\Repositories\EloquentNotificationRepository'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->app->singleton('flarum.avatars.storage', function () {
|
||||||
|
return new Local(__DIR__.'/../../ember/public/avatars');
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->app->when('Flarum\Core\Handlers\Commands\UploadAvatarCommandHandler')
|
||||||
|
->needs('League\Flysystem\FilesystemInterface')
|
||||||
|
->give('flarum.avatars.storage');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerGambits()
|
public function registerGambits()
|
||||||
|
Reference in New Issue
Block a user