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