mercredi 27 mars 2019

Getting syntax error when using foreach in controller

This is my controller and I'm getting syntax error when using foreach in controller

namespace App\Http\Controllers;

use DB;

class course_controller extends Controller {

    public function show_details() {
        $prospects = DB::table('prospect')->get();

        foreach ($prospects as $prospect) {
            DB::table('course_prospect')->insert(['prospect_id' => 
$prospect->id, 'course_id' => $prospect->course_intrested])
        };

    }

}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire