knubbe
2 months ago
476
2
Forge

Laravel Forge Deployment fail with php 7.4 typed property on User model

Posted 2 months ago by knubbe

I create fresh new project in Laravel 7 with php 7.4 and on User model I have this properties:

* The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected array $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected array $casts = [
        'email_verified_at' => 'datetime',
    ];

and on Laravel Homestead everything works fine but when I want to deploy app with Laravel Forge on UserSeeder I got this message:

PHP Fatal error:  Type of App\User::$casts must not be defined (as in class Illuminate\Foundation\Auth\User)

Please sign in or create an account to participate in this conversation.