fomvasss /
laravel-translatable
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Fomvasss\LaravelTranslatable; |
||
| 4 | |||
| 5 | use Illuminate\Database\Schema\Blueprint; |
||
| 6 | |||
| 7 | class ServiceProvider extends \Illuminate\Support\ServiceProvider |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Bootstrap the application services. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function boot() |
||
| 15 | { |
||
| 16 | $this->publishes([ |
||
| 17 | __DIR__ . '/../config/translatable.php' => config_path('translatable.php') |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 18 | ], 'config'); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Register the application services. |
||
| 23 | * |
||
| 24 | * @return void |
||
| 25 | */ |
||
| 26 | public function register() |
||
| 27 | { |
||
| 28 | $this->mergeConfigFrom(__DIR__ . '/../config/translatable.php', 'translatable'); |
||
| 29 | |||
| 30 | Blueprint::macro('translatable', function () { |
||
| 31 | TranslatableColumns::columns($this); |
||
| 32 | }); |
||
| 33 | |||
| 34 | Blueprint::macro('dropTranslatable', function () { |
||
| 35 | TranslatableColumns::dropColumns($this); |
||
| 36 | }); |
||
| 37 | |||
| 38 | } |
||
| 39 | } |
||
| 40 |