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

Everything breaks after install #234

Closed
ghost opened this issue May 1, 2017 · 3 comments
Closed

Everything breaks after install #234

ghost opened this issue May 1, 2017 · 3 comments
Labels
duplicate A repeated issue or entry help wanted Assistance or contributions needed

Comments

@ghost
Copy link

ghost commented May 1, 2017

After installing this package my Laravel installation breaks. After redownloading a fresh copy to try this again, it also breaks. The error I get is as follows:

[Symfony\Component\Debug\Exception\FatalThrowableError] Call to undefined method Closure::__set_state()

These are the steps I followed:

Step 1: composer require owen-it/laravel-auditing

Step 2: Add OwenIt\Auditing\AuditingServiceProvider::class, to my config/app.php inside the providers section.

Step 3: Clear the cache because Laravel doesn't know about this new package php artisan config:cache. Not doing this step obviously results in errors.

Step 4: Final step: php artisan auditing:install

Step 5: Report to this repo as it spews out the above issue.

broken

Any ideas?

@quetzyg
Copy link
Contributor

quetzyg commented May 2, 2017

Hi @jaminscript,

I did the following steps, but could not reproduce such error:

Create a new project:

create-project --prefer-dist laravel/laravel blog

Install the package:

cd blog
composer require owen-it/laravel-auditing

Add OwenIt\Auditing\AuditingServiceProvider::class to the providers array in config/app.php.

Publish the default configuration file:

php artisan auditing:install

Get this output:
auditing-install

@quetzyg quetzyg added the help wanted Assistance or contributions needed label May 2, 2017
@sjmarve
Copy link

sjmarve commented May 3, 2017

Also having the same issue in laravel 5.4. Because of this part in the config/audit.php:

'user' => [
'model' => App\User::class,
'resolver' => function () {
return Auth::check() ? Auth::user()->getAuthIdentifier() : null;
},
],

php artisan config:cache is causing the creation of the following in cache/config.php:

array (
    'user' => 
    array (
      'model' => 'App\\User',
      'resolver' => 
      Closure::__set_state(array(
      )),
    ),
    'default' => 'database',
    'drivers' => 
    array (
      'database' => 
      array (
        'table' => 'audits',
        'connection' => NULL,
      ),
    ),
    'console' => true,
  ),
...    
which is causing the error: 
`Error: Call to undefined method Closure::__set_state()`

@quetzyg
Copy link
Contributor

quetzyg commented May 3, 2017

Use a FQCN instead of a closure. See here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate A repeated issue or entry help wanted Assistance or contributions needed
Projects
None yet
Development

No branches or pull requests

2 participants