Skip to content

feat: add rule for Laravel Timestamps property to attribute#491

Open
yoannblot wants to merge 1 commit intodriftingly:mainfrom
yoannblot:feat/laravel-timestamps-property-to-attribute
Open

feat: add rule for Laravel Timestamps property to attribute#491
yoannblot wants to merge 1 commit intodriftingly:mainfrom
yoannblot:feat/laravel-timestamps-property-to-attribute

Conversation

@yoannblot
Copy link
Copy Markdown

Context

Laravel 13 introduces the WithoutTimestamps attributes (source).

Description

This new rule replaces the old property $timestamps by the new #[WithoutTimestamps] attribute :

 use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;

+#[WithoutTimestamps]
 final class User extends Model
 {
-    public $timestamps = false;
 }

or, removes the property when the value is true, because that's the default behavior :

 use Illuminate\Database\Eloquent\Model;

 final class User extends Model
 {
-    public $timestamps = true;
 }

@yoannblot yoannblot marked this pull request as ready for review April 1, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant