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

Enable or disable module #37

Closed
Morpheons opened this issue May 23, 2021 · 2 comments
Closed

Enable or disable module #37

Morpheons opened this issue May 23, 2021 · 2 comments

Comments

@Morpheons
Copy link

Morpheons commented May 23, 2021

Hi nicolas,
Before i use your module and i use this commande to activ or not a module in my web site

module.json


{
    "name": "Article",
    "alias": "article",
    "description": "Administration des articles",
    "keywords": [],
    "active": 1,
    "order": 0,
    "providers": [
        "Modules\\Article\\Providers\\ArticleServiceProvider"
    ],
    "aliases": [],
    "files": [],
    "requires": []
} 

in my module page i make as :
module.blade.php

@foreach ($modules as $module)
    <tr>
        <td>{{ $module->getname() }}</td>
        <td>{{ $module->getdescription()}}</td>
        <td>
            @if($module->getname() != "Admin" )
                <form method="post" action="{{route('admin_etat_module')}}">
                    <input type="hidden" name="modulename" value="{{$module->getname()}}"/>
                    <input type="checkbox"
                           name="etat" @if($module->active) checked  @endif
                           data-size="xs"
                           class="submit"
                           data-style="slow "
                    />
                    {{csrf_field()}}
                </form>
           @endif
        </td>
    </tr>
@endforeach

But in a new version i have this error

Undefined property: Nwidart\Modules\Laravel\Module::$active (View: E:\01-www\a2imv2\Modules\Admin\Resources\views\module.blade.php)

How i can make it for enable or disable module for my all user?

thanks for your help!

@finalbytes
Copy link

I guess this is what you're looking for:
https://nwidart.com/laravel-modules/v6/advanced-tools/module-methods

@dcblogdev
Copy link
Collaborator

Please use the issue tracker of the package: https://github.com/nWidart/laravel-modules

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