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

Using rule object in AutoCRUD schema config causing config:cache not working #151

Open
uyab opened this issue Apr 17, 2022 · 0 comments
Open
Labels
bug Something isn't working
Milestone

Comments

@uyab
Copy link
Contributor

uyab commented Apr 17, 2022

How to reproduce

  1. Define AutoCRUD schema:
  2. Jalankan php artisan config:cache
<?php

return [
    'label' => 'Company',
    'model' => \App\Models\Company::class,
    'table' => \App\Http\Livewire\Table\CompanyTable::class,
    'schema' => [
        [
            'name' => 'name',
            'type' => 'text',
            'label' => 'Company Name',
            'limit' => 4,
            'rules' => ['required', \Illuminate\Validation\Rule::unique('companies')],
        ],
        [
            'field' => '',
            'type' => \Laravolt\Fields\Field::BUTTON,
            'label' => 'Settings',
            'icon' => 'settings',
            'show_on_index' => true,
            'show_on_detail' => false,
            'show_on_create' => false,
            'show_on_edit' => false,
        ],
    ],
];

Ekspektasi
No error

Realita/Screenshots

   LogicException

  Your configuration files are not serializable.

  at vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php:82
     78require $configPath;
     79▕         } catch (Throwable $e) {
     80$this->files->delete($configPath);
     81▕
  ➜  82throw new LogicException('Your configuration files are not serializable.', 0, $e);
     83▕         }
     8485$this->info('Configuration cached successfully.');
     86▕     }

  1   bootstrap/cache/config.php:595
      Error::("Call to undefined method Illuminate\Validation\Rules\Unique::__set_state()")

      +25 vendor frames
  27  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
@uyab uyab added the bug Something isn't working label Apr 17, 2022
@uyab uyab added this to the V6 milestone Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant