Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Class 'DashboardMenu' not found" #60

Open
acecx opened this issue Mar 25, 2018 · 6 comments
Open

"Class 'DashboardMenu' not found" #60

acecx opened this issue Mar 25, 2018 · 6 comments

Comments

@acecx
Copy link

acecx commented Mar 25, 2018

"Class 'DashboardMenu' not found"

webed/plugins/custom-fields/src/Providers/BootstrapModuleServiceProvider.php
$this->booted();
});
}

/**
 * Register the application services.
 *
 * @return void
 */
public function register()
{

}

protected function booted()
{
    /**
     * Register to dashboard menu
     */
    \DashboardMenu::registerItem([
        'id' => 'webed-custom-fields',
        'priority' => 20.1,
        'parent_id' => null,
        'heading' => null,
        'title' => 'Custom fields',
        'font_icon' => 'icon-briefcase',
        'link' => route('admin::custom-fields.index.get'),
        'css_class' => null,
        'permissions' => ['view-custom-fields'],
    ]);

    $this->registerUsersFields();
@duysolo
Copy link
Owner

duysolo commented Mar 26, 2018

Use dashboard_menu()->registerItem instead of \DashboardMenu::registerItem

@acecx
Copy link
Author

acecx commented Mar 26, 2018

Thanks.

/webed/plugins/custom-fields/src/Providers/BootstrapModuleServiceProvider.php
protected function registerPagesFields()
{
custom_field_rules()->registerRule('Basic', 'Page template', 'page_template', get_templates('Page'))
->registerRule('Basic', 'Page', 'page', function () {
$pageRepository = $this->app->make(\WebEd\Base\Pages\Repositories\Contracts\PageContract::class);
$pages = $pageRepository->get();
$pageArray = [];
foreach ($pages as $row) {
$pageArray[$row->id] = $row->title;
}
return $pageArray;
})
->registerRule('Other', 'Model name', 'model_name', [
'page' => 'Page'
]);
}

protected function registerBlogFields()
{
    if (modules_management()->isActivated('webed-blog') && modules_management()->isInstalled('webed-blog')) {
        custom_field_rules()->registerRuleGroup('Blog')
            ->registerRule('Blog', 'Post template', 'blog.post_template', get_templates('Post'))
            ->registerRule('Blog', 'Category template', 'blog.category_template', get_templates('Category'))
            ->registerRule('Blog', 'Category', 'blog.category', function () {
                $categories = get_categories();

                $categoriesArr = [];
                foreach ($categories as $row) {
                    $categoriesArr[$row->id] = $row->indent_text . $row->title;
                }
                return $categoriesArr;
            })
            ->registerRule('Blog', 'Posts with related category', 'blog.post_with_related_category', function () {
                $categories = get_categories();

                $categoriesArr = [];
                foreach ($categories as $row) {
                    $categoriesArr[$row->id] = $row->indent_text . $row->title;
                }
                return $categoriesArr;

Arguments
"Call to undefined method WebEd\Base\ModulesManagement\Support\ModulesManagement::isActivated()"

@duysolo
Copy link
Owner

duysolo commented Mar 26, 2018

What WebEd version are you using?

@acecx
Copy link
Author

acecx commented Mar 26, 2018

Installed by:
#composer create-project --prefer-dist sgsoft-studio/webed webed
Installing sgsoft-studio/webed (4.0.5)

@acecx
Copy link
Author

acecx commented Mar 26, 2018

Shall I do with git clone?

@renalcio
Copy link

@acecx change modules_management() to webed_plugins()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants