mirror of
https://github.com/flarum/framework.git
synced 2024-11-24 08:54:21 +08:00
Wire up instantiation of Flysystem adapter for avatar storage.
This commit is contained in:
parent
100a5038bf
commit
e4ed057557
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user