Conditions | 2 |
Paths | 2 |
Total Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function boot() |
||
12 | { |
||
13 | if ($this->app->runningInConsole()) { |
||
14 | $this->publishes([ |
||
15 | __DIR__.'/../config/laravel-trix.php' => config_path('laravel-trix.php'), |
||
16 | ], 'config'); |
||
17 | |||
18 | $this->publishes([ |
||
19 | __DIR__.'/../database/migrations/create_trix_rich_texts_table.php.stub' => $this->app->databasePath().'/migrations/'.date('Y_m_d_His').'_create_trix_rich_texts_table.php', |
||
20 | ], 'migrations'); |
||
21 | } |
||
22 | |||
23 | Route::group([ |
||
24 | 'prefix' => 'laravel-trix', |
||
25 | ], function () { |
||
26 | Route::post('attachment', config('laravel-trix.store_attachment_action'))->name('laravel-trix.store'); |
||
27 | Route::delete('attachment/{attachment}', config('laravel-trix.destroy_attachment_action'))->name('laravel-trix.destroy'); |
||
28 | }); |
||
29 | |||
30 | $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-trix'); |
||
31 | |||
32 | Blade::directive('trixassets', function () { |
||
33 | return "<?php echo view('laravel-trix::trixassets')->render(); ?>"; |
||
34 | }); |
||
35 | |||
36 | Blade::directive('trix', function ($expression) { |
||
37 | return "{!! app('laravel-trix')->make($expression) !!}"; |
||
38 | }); |
||
39 | } |
||
40 | |||
50 |