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

Unable to refresh. InvalidClassException. #110

Open
aliharis opened this issue May 10, 2016 · 2 comments
Open

Unable to refresh. InvalidClassException. #110

aliharis opened this issue May 10, 2016 · 2 comments

Comments

@aliharis
Copy link

I am using Laravel 5.2.

I have a model called Form, which implements StaperableInterface. Uploading works well. But I am unable to use the refresh command successfully.

I have tried
php artisan stapler:refresh Form
php artisan stapler:refresh App\Form

I keep receiving the invalid class exception.

Any help is appreciated. Thank you.

screen shot 2016-05-10 at 1 14 06 pm

@tabennett
Copy link
Contributor

When the refresh service starts the refresh process, it executes the following code:

$model = $this->app->make($className);

if (!$model instanceof StaplerableInterface) {
    throw new InvalidClassException("Invalid class: the $className class is not currently using Stapler.", 1);
}

Where $className is the value of the string you pass in. So it looks like your app (more specifically your application container) isn't resolving an instance of your Form model but is instead creating an instance of some other class (which doesn't implement StaplerableInterface).

@mrchimp
Copy link

mrchimp commented Jul 12, 2016

Try wrapping the class name in quotes. E.g.

php artisan stapler:refresh "App\Form"

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