Disabling automaticNavigation from Capsules

Hi folks, how can i disable automaticNavigation from Capsules
1 Reply
afatmustafa
afatmustafa11mo ago
Or being able to change the title would work too. I solved the problem by overriding the registerCapsule() function in TwillPackageServiceProvider which extends in SomeCapsuleServiceProvider.
class SomeCapsuleServiceProvider extends TwillPackageServiceProvider
{
protected function registerCapsule(string $name): void
{
$namespace = $this->getCapsuleNamespace();

$namespace .= '\\Twill\\Capsules\\' . $name;

$dir = $this->getPackageDirectory() . DIRECTORY_SEPARATOR .
'src' . DIRECTORY_SEPARATOR .
'Twill' . DIRECTORY_SEPARATOR .
'Capsules' . DIRECTORY_SEPARATOR . $name;

\A17\Twill\Facades\TwillCapsules::registerPackageCapsule($name, $namespace, $dir, automaticNavigation: false);
}
}`
class SomeCapsuleServiceProvider extends TwillPackageServiceProvider
{
protected function registerCapsule(string $name): void
{
$namespace = $this->getCapsuleNamespace();

$namespace .= '\\Twill\\Capsules\\' . $name;

$dir = $this->getPackageDirectory() . DIRECTORY_SEPARATOR .
'src' . DIRECTORY_SEPARATOR .
'Twill' . DIRECTORY_SEPARATOR .
'Capsules' . DIRECTORY_SEPARATOR . $name;

\A17\Twill\Facades\TwillCapsules::registerPackageCapsule($name, $namespace, $dir, automaticNavigation: false);
}
}`