feat!: upgrade to Laravel 13 compatibility
- Update laravel/framework to ^13.0, tinker to ^3.0, query-builder to ^7.0 - Migrate User model to #[Fillable] and #[Hidden] attributes (Laravel 13 pattern) - Add LARAVEL_130 ruleset to Rector configuration - Add PHP 8.4 to CI test matrix - Update README badges and description for Laravel 13 BREAKING CHANGE: requires Laravel 13.x, drops Laravel 12 support
This commit is contained in:
@@ -6,6 +6,8 @@ namespace App\Models;
|
||||
|
||||
use Database\Factories\UserFactory;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Attributes\Hidden;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@@ -21,6 +23,15 @@ use Laravel\Sanctum\HasApiTokens;
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*/
|
||||
#[Fillable([
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
])]
|
||||
#[Hidden([
|
||||
'password',
|
||||
'remember_token',
|
||||
])]
|
||||
final class User extends Authenticatable implements MustVerifyEmail
|
||||
{
|
||||
use HasApiTokens;
|
||||
@@ -30,27 +41,6 @@ final class User extends Authenticatable implements MustVerifyEmail
|
||||
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user