Changes model empty guarded property to use the Unguarded attribute
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Attributes\Unguarded;
+#[Unguarded]
class User extends Model
{
- protected $guarded = [];
}
Configure your rector.php:
<?php
use RectorLaravel\Rector\Class_\EmptyGuardedPropertyToUnguardedAttributeRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
EmptyGuardedPropertyToUnguardedAttributeRector::class,
]);