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

Why captcha does not exist ? #46

Closed
tob47 opened this issue Sep 4, 2016 · 11 comments
Closed

Why captcha does not exist ? #46

tob47 opened this issue Sep 4, 2016 · 11 comments

Comments

@tob47
Copy link

tob47 commented Sep 4, 2016

ErrorException in Container.php line 734:
Class captcha does not exist (View: /var/www/html/larapus/resources/views/auth/register.blade.php)

@tob47 tob47 changed the title Why captcha doues not exist ? Why captcha does not exist ? Sep 4, 2016
@anhskohbo
Copy link
Owner

Hi, could I see your auth/register.blade.php file?

And pls make sure you have NoCaptcha in service providers:

Anhskohbo\NoCaptcha\NoCaptchaServiceProvider::class,

@tob47
Copy link
Author

tob47 commented Sep 5, 2016

auth/register.blade.php

`@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Register</div>
                <div class="panel-body">
                    {!! Form::open(['url'=>'/register', 'class'=>'form-horizontal']) !!}
                    <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
                    {!! Form::label('name', 'Nama', ['class'=>'col-md-4 control-label']) !!}
                    <div class="col-md-6">
                    {!! Form::text('name', null, ['class'=>'form-control']) !!}
                    {!! $errors->first('name', '<p class="help-block">:message</p>') !!}
                    </div>
                    </div>
                    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                    {!! Form::label('email', 'Alamat Email', ['class'=>'col-md-4 control-label']) !!}
                    <div class="col-md-6">
                    {!! Form::email('email', null, ['class'=>'form-control']) !!}
                    {!! $errors->first('email', '<p class="help-block">:message</p>') !!}
                    </div>
                    </div>
                    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                    {!! Form::label('password', 'Password', ['class'=>'col-md-4 control-label']) !!}
                    <div class="col-md-6">
                    {!! Form::password('password', ['class'=>'form-control']) !!}
                    {!! $errors->first('password', '<p class="help-block">:message</p>') !!}
                    </div>
                    </div>
                    <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
                    {!! Form::label('password_confirmation', 'Konfirmasi Password', ['class'=>'col-md-4 control-label']) !!}
                    <div class="col-md-6">
                    {!! Form::password('password_confirmation', ['class'=>'form-control']) !!}
                    {!! $errors->first('password_confirmation', '<p class="help-block">:message</p>') !!}
                    </div> 
                    </div> 
                    <div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
                    <div class="col-md-offset-4 col-md-6">
                    {!! app('captcha')->display() !!}
                    {!! $errors->first('g-recaptcha-response', '<p class="help-block">:message</p>') !!}
                    </div>
                    </div>
                    <div class="form-group">
                    <div class="col-md-6 col-md-offset-4">
                    <button type="submit" class="btn btn-primary">
                    <i class="fa fa-btn fa-user"></i> Daftar
                    </button>
                    </div>
                    </div>
                    {!! Form::close() !!}
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

`

And Providers in config/App.php

` 'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Auth\AuthServiceProvider::class,
    Illuminate\Broadcasting\BroadcastServiceProvider::class,
    Illuminate\Bus\BusServiceProvider::class,
    Illuminate\Cache\CacheServiceProvider::class,
    Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    Illuminate\Cookie\CookieServiceProvider::class,
    Illuminate\Database\DatabaseServiceProvider::class,
    Illuminate\Encryption\EncryptionServiceProvider::class,
    Illuminate\Filesystem\FilesystemServiceProvider::class,
    Illuminate\Foundation\Providers\FoundationServiceProvider::class,
    Illuminate\Hashing\HashServiceProvider::class,
    Illuminate\Mail\MailServiceProvider::class,
    Illuminate\Pagination\PaginationServiceProvider::class,
    Illuminate\Pipeline\PipelineServiceProvider::class,
    Illuminate\Queue\QueueServiceProvider::class,
    Illuminate\Redis\RedisServiceProvider::class,
    Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
    Illuminate\Session\SessionServiceProvider::class,
    Illuminate\Translation\TranslationServiceProvider::class,
    Illuminate\Validation\ValidationServiceProvider::class,
    Illuminate\View\ViewServiceProvider::class,
    Collective\Html\HtmlServiceProvider::class,
    Zizaco\Entrust\EntrustServiceProvider::class,
    Yajra\Datatables\DatatablesServiceProvider::class,
    Anhskohbo\NoCaptcha\NoCaptchaServiceProvider::class,


    /*
     * Application Service Providers...
     */
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,

],`

@suciptoid
Copy link

Have same issue, with laravel 5.3

@shurizzle
Copy link

php artisan config:cache

@suciptoid
Copy link

thanks @shurizzle, it's working.

@alenzx
Copy link

alenzx commented Mar 15, 2017

thanks @shurizzle ,it's working.

@NinioDev
Copy link

NinioDev commented Dec 6, 2017

I have fixed it by simply typing:
composer require anhskohbo/no-captcha
And it works..

@martsie
Copy link

martsie commented Dec 7, 2018

having this issue on laravel forge as well... worked fine in our docker instances and our CI including all the automated testing but as soon as it deployed to production our entire site shut down. When I try to do a composer require anhskohbo/no-captcha server runs out of memory.

@hyperflux
Copy link

Manually adding \Anhskohbo\NoCaptcha\NoCaptchaServiceProvider::class to config/app.php was the only way this would work on production for me. I would like to know why it worked locally without it being explicitly added. Anybody have any insight? I could probably research the answer myself, but...

@rambo666
Copy link

Place both of them together

 <label for="ReCaptcha">Recaptcha:</label>
          {!! NoCaptcha::renderJs() !!}
          {!! NoCaptcha::display() !!}``

@Soroosh-N
Copy link

@rambo666 Why this is happening? Your answer worked for me! Thanks!

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

10 participants