Skip to content

Commit

Permalink
Add PackageServiceProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
pboivin committed Dec 17, 2021
1 parent b0373d9 commit 127aef1
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/PackageServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace A17\Twill;

use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;

class PackageServiceProvider extends ServiceProvider
{
protected function registerVueComponentsDirectory($path)
{
$this->publishes(
[$path => resource_path(config('twill.vendor_components_resource_path'))],
'components'
);
}

protected function registerBlocksDirectory($path)
{
$blocks = Config::get('twill.block_editor.directories.source.blocks');

$blocks[] = [
'path' => $path,
'source' => 'vendor',
];

Config::set('twill.block_editor.directories.source.blocks', $blocks);
}

protected function registerRepeatersDirectory($path)
{
$repeaters = Config::get('twill.block_editor.directories.source.repeaters');

$repeaters[] = [
'path' => $path,
'source' => 'vendor',
];

Config::set('twill.block_editor.directories.source.repeaters', $repeaters);
}
}

0 comments on commit 127aef1

Please sign in to comment.