Regress to add parsedown to service container

This commit is contained in:
Pig Fang 2018-09-08 20:09:56 +08:00
parent a09648c79d
commit d01daa4137
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,6 @@ use URL;
use Mail;
use View;
use Session;
use Parsedown;
use App\Models\User;
use App\Models\Texture;
use Illuminate\Http\Request;
@ -39,7 +38,7 @@ class UserController extends Controller
'players' => $this->calculatePercentageUsed($user->players->count(), option('score_per_player')),
'storage' => $this->calculatePercentageUsed($user->getStorageUsed(), option('score_per_storage'))
],
'announcement' => (new Parsedown())->text(option_localized('announcement'))
'announcement' => app('parsedown')->text(option_localized('announcement'))
]);
}

View File

@ -65,6 +65,8 @@ class AppServiceProvider extends ServiceProvider
View::addExtension('tpl', 'blade');
// Make the priority of *.blade.php higher than *.tpl
View::addExtension('blade.php', 'blade');
$this->app->singleton('parsedown', \Parsedown::class);
}
/**