samedi 17 octobre 2015

Laravel - Class not found upon using the "new" method

I have a model named MedicalQualification, which is related to the medical_qualifications table.

The code within the model is:

namespace App;

use Illuminate\Database\Eloquent\Model;

class MedicalQualification extends Model
{
    protected $table = 'medical_qualifications';

    protected $fillable = ['consultant_id', 'medical_qualification'];

}

I am wanting to add to this table within a controller function:

use App\MedicalQualification;

foreach (Input::get('medical_qualifications') as $qualification)
{
    $selected[] = New MedicalQualification(['medical_qualification' => $qualification]);
}

When this function is called, I am presented with this error:

FatalErrorException in Model.php line 906: Class 'MedicalQualification' not found

Any help would be greatly appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire