Home > Software design >  Class "App\Http\Controllers\Survey" not found
Class "App\Http\Controllers\Survey" not found

Time:03-10

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.

CodePudding user response:

Where is your model Survey.php?

If in app/Models then you need to

use App\Models\Survey;
  • Related