dashboard route

Hello. I have a problem with dashboard config I have a Category and CategoryArticle Models I have a dashboard config in twill.php
'dashboard' => [
'modules' =>
[
'categories' =>
[
'name' => 'categories',
'label' => 'Category',
'create' => true,
'search' => true,
'count' => true,
],
'category' =>
[
'name' => 'categoryArticle',
'label' => 'Article',
'create' => true,
'search' => true,
'count' => true,
]
]
]
'dashboard' => [
'modules' =>
[
'categories' =>
[
'name' => 'categories',
'label' => 'Category',
'create' => true,
'search' => true,
'count' => true,
],
'category' =>
[
'name' => 'categoryArticle',
'label' => 'Article',
'create' => true,
'search' => true,
'count' => true,
]
]
]
With config like that id i go to dashboard I have a error
Route [twill.categoryArticle.index] not defined.
Route [twill.categoryArticle.index] not defined.
my route twill.php file
TwillRoutes::module('categories');
TwillRoutes::module('categories.articles');
TwillRoutes::module('categories');
TwillRoutes::module('categories.articles');
where I make a error.? Thx for answer
10 Replies
bohous
bohousOP2y ago
when I change name from categoryArticle to categories.articles I have other error Target class [App\Repositories\Categories.articleRepository] does not exist.
kallefrombosnia
Try to setup it like this
'dashboard' => [
'modules' =>
[
'App\Models\Category' =>
[
'name' => 'categories',
'label' => 'Category',
'create' => true,
'search' => true,
'count' => true,
],
'App\Models\CategoryArticle' =>
[
'name' => 'categoryArticle',
'label' => 'Article',
'create' => true,
'search' => true,
'count' => true,
]
]
]
'dashboard' => [
'modules' =>
[
'App\Models\Category' =>
[
'name' => 'categories',
'label' => 'Category',
'create' => true,
'search' => true,
'count' => true,
],
'App\Models\CategoryArticle' =>
[
'name' => 'categoryArticle',
'label' => 'Article',
'create' => true,
'search' => true,
'count' => true,
]
]
]
Change the name of the Models if needed, this just an example. @bohous
bohous
bohousOP2y ago
thnks but to same error. my config now
'modules' =>
[
'\App\Models\Category' =>
[
'name' => 'categories',
'label' => 'Category',
'create' => true,
'search' => true,
'count' => true,
],
'\App\Models\CategoryArticle' =>
[
'name' => 'categoryArticle',
'label' => 'Article',
'create' => true,
'search' => true,
'count' => true,
]
]
'modules' =>
[
'\App\Models\Category' =>
[
'name' => 'categories',
'label' => 'Category',
'create' => true,
'search' => true,
'count' => true,
],
'\App\Models\CategoryArticle' =>
[
'name' => 'categoryArticle',
'label' => 'Article',
'create' => true,
'search' => true,
'count' => true,
]
]
error
Route [twill.categoryArticle.index] not defined.
Route [twill.categoryArticle.index] not defined.
kallefrombosnia
Are you sure that this is related to this setup? That looks like a twill-navigation.php error Something is off in your naming of \App\Models\CategoryArticle. Try to use nested module route there.
bohous
bohousOP2y ago
my setup is step to step to same as in documentation for nested modules. what kind of route you mean.?
bohous
bohousOP2y ago
but it is look like for parent-child modules the dashboard isnt work . may some code improvement will be help. if will be there a new array key for that purpose. In fashboardController:529 . Anytime isnt way to ovveride that class.?
kallefrombosnia
To be honest, idk really how that should work. Ping @ifox.dev
ifox
ifox2y ago
in a dashboard.modules entry you can specify a repository key
ifox
ifox2y ago
GitHub
twill/DashboardController.php at 29db4a8c6ce25263c0c3f86ecdff568b0d...
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/c...
Want results from more Discord servers?
Add your server