mercredi 13 mars 2019

Laravel class undefined after config:clear

App\Constant\ProductConstant.php

<?php

namespace App\Constant;

use App\Constant\BaseConstant;

class ProductConstant extends BaseConstant {

    const TITLE = "title";
}

Product.php

<?php

namespace App\Models;

use App\Constant\ProductConstant;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    protected $table = 'products';

    protected $fillable = [ProductConstant::TITLE, ProductConstant::IMAGE, ProductConstant::EXPIRY_DATE, ProductConstant::MAX_PARTICIPANTS, ProductConstant::TOTAL_PARTICIPANTS];

Error

Undefined class constant 'App\Constant\ProductConstant::TITLE'

After I've executed php artisan config:clear. May I know what's the reason?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire