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.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2IjxhPp
via IFTTT

Aucun commentaire:

Enregistrer un commentaire