parsedown/laravelへの依存を削除し、同等のBladeディレクティブを移植
This commit is contained in:
parent
233a54eb3e
commit
e6b28993de
@ -3,7 +3,9 @@
|
|||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use App\MetadataResolver\MetadataResolver;
|
use App\MetadataResolver\MetadataResolver;
|
||||||
|
use Illuminate\Support\Facades\Blade;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Parsedown;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -14,7 +16,9 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
//
|
Blade::directive('parsedown', function ($expression) {
|
||||||
|
return "<?php echo app('parsedown')->text($expression); ?>";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,5 +31,8 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$this->app->singleton(MetadataResolver::class, function ($app) {
|
$this->app->singleton(MetadataResolver::class, function ($app) {
|
||||||
return new MetadataResolver();
|
return new MetadataResolver();
|
||||||
});
|
});
|
||||||
|
$this->app->singleton('parsedown', function () {
|
||||||
|
return Parsedown::instance();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
"guzzlehttp/guzzle": "^6.3",
|
"guzzlehttp/guzzle": "^6.3",
|
||||||
"laravel/framework": "5.5.*",
|
"laravel/framework": "5.5.*",
|
||||||
"laravel/tinker": "~1.0",
|
"laravel/tinker": "~1.0",
|
||||||
"misd/linkify": "^1.1",
|
"misd/linkify": "^1.1"
|
||||||
"parsedown/laravel": "~1.0"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.1",
|
"barryvdh/laravel-debugbar": "^3.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user