mercredi 4 mai 2022

Undefined class constant 'MAIN'

We have the following migration:

class CreateAccounts extends Migration
{

    public function up()
    {
        $data= [
            "id" => \App\Account::MAIN,
            "container" => null,               
        ];

        \App\Account::create($data);
    }

}

And here is the class Account, it contains some constants and methods:

namespace App;

use Illuminate\Database\Eloquent\SoftDeletes;

    class Account extends MainModel
    {
        const MAIN = 47;
    
    ...
    
    }

The migration works fine in our dev server but on production it complaints saying

Undefined class constant 'MAIN'

The same error from tinker.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire