Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Class "App\Http\Controllers\Survey" not found

Good day. My group our currently working in our final project using Laravel. I have this problem that I encounter.

  <?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use app\database\seeders\Survey;

class SurveySeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $survey = Survey::create(['name' => 'Register Form', 'settings' => ['accept-guest-entries' => true]]);

    $survey->questions()->create([
        'content' => 'First Name',
    ]);

    $survey->questions()->create([
        'content' => 'Last Name',
    ]);

    $survey->questions()->create([
        'content' => 'Date of Birth (MM/DD/YYYY)',
    ]);

    $survey->questions()->create([
        'content' => 'Full Address',
    ]);

    $survey->questions()->create([
        'content' => 'Blood Group',
        'type' => 'radio',
        'options' => ['A', 'B', 'O', 'AB']
    ]);

    $survey->questions()->create([
        'content' => 'Phone Number',
        'type' => 'number',
        'rules' => ['numeric', 'min:11', 'max:11']
    ]);
}

}

I found some solutions but it doesn’t work for me. I hope you can help me to get through this.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Where is your model Survey.php?

If in app/Models then you need to

use App\Models\Survey;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading