TC
Twill CMS•17mo ago
afatmustafa

Disabling automaticNavigation from Capsules

Hi folks, how can i disable automaticNavigation from Capsules
2 Replies
afatmustafa
afatmustafaOP•17mo 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);
}
}`
psenik
psenik•6mo ago
You solved my problem too! Thanks 🙂 I didnt even created a custom class, just pasted registering capsule in my existing Capsule provider
Want results from more Discord servers?
Add your server