deiucanta / laravel-smart

Automatic Migrations, Validation and More
48 stars 7 forks source link

Error: Class 'Deiucanta\Smart\Rule' not found #9

Closed robsontenorio closed 6 years ago

robsontenorio commented 6 years ago
public function fields()
    {
        return [
            Field::make('id')->increments(),
            Field::make('code')->unsignedInteger()->unique(),
        ];
    }
 Symfony\Component\Debug\Exception\FatalThrowableError  : Class 'Deiucanta\Smart\Rule' not found

  at /Volumes/BackupHD/dev/laravel-smart/src/FieldRules.php:295
    291|     // url is in FieldTypes
    292|
    293|     protected function makeUniqueRule($model)
    294|     {
  > 295|         $rule = Rule::unique($model->getTable(), $this->name);
    296|
    297|         if ($model->getKey()) {
    298|             $rule->ignore($model->getKey(), $model->getKeyName());
    299|         }

Just missing a import

use Illuminate\Validation\Rule;