Disable 'Register a new member' in login page



  • If I asgard.user.users.php in the file in the config folder
    'Allow_user_registration' => false,
    put on false then throws the registration in the login form an error.
    We can I disable the registration link without error.
    I use laravel> 5
    Best regards
    Dieter

    My Error
    ErrorException in UrlGenerator.php line 306: Route [register] not defined. (View: C: \ xampp \ htdocs \ xxxxx \ resources \ views \ asgard \ user \ public \ login.blade.php)


  • Global Moderator

    @dieter said:
    For some reason published view from users module have no condition around register route call :s

    Please update in resources/views/asgard/users/public/login.blade.php:
    change

    <a href="{{ route('register')}}" class="text-center">{{ trans('user::auth.register')}}</a>
    

    to

            @if (config('asgard.user.users.allow_user_registration'))
                <a href="{{ route('register')}}" class="text-center">{{ trans('user::auth.register')}}</a>
            @endif
    

    clear view cache if not reflected php artisan view:clear



  • Thanks for the help. But
    @if (config ('asgard.user.users.allow_user_registration'))
    <a href="{{ route('register')}}" class="text-center"> {{trans ( 'user :: auth.register')}} code
    @endif
    has been standing already inside and the command also
    php artisan view: clear
    made nothing?
    I will now times simply hide the link via css.
    Best regards
    Dieter


  • Global Moderator

    @dieter

    Well option in config should be lowercase => allow_user_registration. Also register route call should be wrapped in if statement. Then it will not try to generate that url.



  • Problem solved. For me it has given 2 login.blade.php files. I was inside in the wrong. When the correct file your assistance has helped.
    You are the best :))

    Thank you very much
    Dieter


Log in to reply